package com.kurumi.service.impl;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.kurumi.pojo.MedicalRecordPageIndex2016;
import com.kurumi.query.PageIndexRefQuery;
import com.kurumi.service.MedicalRecordPageIndexWjtCheckService;
import com.kurumi.util.DateUtil;
import com.kurumi.util.IDCardUtils;
import com.kurumi.util.StringUtil;
@Service
public class MedicalRecordPageIndexWjtCheckServiceImpl implements MedicalRecordPageIndexWjtCheckService {

	@Override
	public List<Map<String, Object>> pageIndexCheckWjt(List<MedicalRecordPageIndex2016> pageIndexs,
			Map<String, Map<String, String>> pageIndexDectRefs, Map<String, Map<String, Object>> gbtDectRefs) {
		// TODO Auto-generated method stub
		List<Map<String, Object>> errorMedicalRecords = new ArrayList<Map<String, Object>>();

		for (MedicalRecordPageIndex2016 checkPageIndex : pageIndexs) {
			StringBuilder errorDesc = new StringBuilder();
			if(checkPageIndex.getOrgCode() == null){
				addErrorDesc(errorDesc,"医疗机构代码不应为空");
			}else if(checkPageIndex.getOrgCode().length() > 22){
				addErrorDesc(errorDesc,"医疗机构代码长度不应大于22");
			}
			if(checkPageIndex.getOrgName() == null){
				addErrorDesc(errorDesc,"医疗机构名称不应为空");
			}else if(checkPageIndex.getOrgName().length() > 80){
				addErrorDesc(errorDesc,"医疗机构名称长度不应大于80");
			}
			if(checkPageIndex.getMedicalInsuranceNumber() != null){
				if(checkPageIndex.getMedicalInsuranceNumber().length() > 50){
					addErrorDesc(errorDesc,"医疗保险手册（卡）号长度不应大于50");
				}
			}
			if(checkPageIndex.getMedicalHealthNumber() != null){
				if(checkPageIndex.getMedicalHealthNumber().length() > 50){
					addErrorDesc(errorDesc,"健康卡号长度不应大于50");
				}
			}

			if(checkPageIndex.getMedicalPayTypeCode() == null){
				addErrorDesc(errorDesc,"医疗付费方式不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC032");
				query.setCode(checkPageIndex.getMedicalPayTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"医疗付费方式:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getVisitNumber() == null){
				addErrorDesc(errorDesc,"住院次数不应为空");
			}else if(checkPageIndex.getVisitNumber().intValue() > 999){
				addErrorDesc(errorDesc,"住院次数长度不应大于3");
			}else if(checkPageIndex.getVisitNumber().intValue() <=0){
				addErrorDesc(errorDesc,"住院次数应为大于0的整数");
			}
			if(checkPageIndex.getMrId() == null){
				addErrorDesc(errorDesc,"病案号不应为空");
			}else if(checkPageIndex.getMrId().length() > 20){
				addErrorDesc(errorDesc,"病案号长度不应大于20");
			}
			if(checkPageIndex.getPatientName() == null){
				addErrorDesc(errorDesc,"姓名不应为空");
			}else if(checkPageIndex.getPatientName().length() > 40){
				addErrorDesc(errorDesc,"姓名长度不应大于40");
			}
			if(checkPageIndex.getSexCode() == null){
				addErrorDesc(errorDesc,"性别不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC001");
				query.setCode(checkPageIndex.getSexCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"性别:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getBirthday() == null){
				addErrorDesc(errorDesc,"出生日期不应为空");
			}
			if(checkPageIndex.getYearOfAge()!=null){
				if(checkPageIndex.getYearOfAge()<0){
					addErrorDesc(errorDesc,"年龄（岁）应大于等于0");
				}else if(checkPageIndex.getYearOfAge()>999){
					addErrorDesc(errorDesc,"年龄（岁）长度不应大于3");
				}
			}
			if(checkPageIndex.getMarriageCode() == null){
				addErrorDesc(errorDesc,"婚姻状况不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC002");
				query.setCode(checkPageIndex.getMarriageCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"婚姻状况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getProfessionCode() == null ){
				addErrorDesc(errorDesc,"职业不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC003");
				query.setCode(checkPageIndex.getProfessionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"职业:"+query.getName()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getProvinceNameOfBirthAddress()== null){
				addErrorDesc(errorDesc,"出生省份不应为空");
			}else{
				if(checkPageIndex.getProvinceNameOfBirthAddress().length() > 30){
					addErrorDesc(errorDesc,"出生省份长度不应大于30");
				}
			}
			if(checkPageIndex.getCityNameOfBirthAddress()== null){
				addErrorDesc(errorDesc,"出生地市不应为空");
			}else{
				if(checkPageIndex.getCityNameOfBirthAddress().length() > 30){
					addErrorDesc(errorDesc,"出生地市长度不应大于30");
				}
			}
			if(checkPageIndex.getCountyNameOfBirthAddress()== null){
				addErrorDesc(errorDesc,"出生地县不应为空");
			}else{
				if(checkPageIndex.getCountyNameOfBirthAddress().length() > 30){
					addErrorDesc(errorDesc,"出生地县长度不应大于30");
				}
			}

			if(checkPageIndex.getNationCode()== null){
				addErrorDesc(errorDesc,"民族不应为空");
			}else{
				if(checkPageIndex.getNationCode().length() > 20){
					addErrorDesc(errorDesc,"民族长度不应大于20");
				}
			}

			if(checkPageIndex.getNationalityCode()== null){
				addErrorDesc(errorDesc,"国籍不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("2659-2000");
				query.setCode(checkPageIndex.getNationalityCode());
				if(!checkGbtDectRef(gbtDectRefs,query)){
					addErrorDesc(errorDesc,"国籍:"+query.getName()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getIdNumber() != null){
				if(checkPageIndex.getIdNumber().length() > 18){
					addErrorDesc(errorDesc,"身份证号长度不应大于18");
				}else{
					if(!checkPageIndex.getIdNumber().equalsIgnoreCase("-")){
						if(!IDCardUtils.isValid(checkPageIndex.getIdNumber())){
							addErrorDesc(errorDesc,"身份证号:"+checkPageIndex.getIdNumber()+",不符合规则");
						}
					}

				}
			}
			if(checkPageIndex.getPermanentAddress()!= null){
				if(checkPageIndex.getPermanentAddress().length() > 200){
					addErrorDesc(errorDesc,"现住地长度不应大于200");
				}
			}

			if(checkPageIndex.getPermanentAddressPhone()!= null){
				if(checkPageIndex.getPermanentAddressPhone().length() > 40){
					addErrorDesc(errorDesc,"住宅电话长度不应大于40");
				}
			}
			if(checkPageIndex.getPermanentAddressPostCode() != null){
				if(checkPageIndex.getPermanentAddressPostCode().length() > 6){
					addErrorDesc(errorDesc,"现住址邮政编码长度不应大于6");
				}
			}
			if(checkPageIndex.getWorkUnitNameAndAddress() != null){
				if(checkPageIndex.getWorkUnitNameAndAddress().length() > 200){
					addErrorDesc(errorDesc,"工作单位及地址长度不应大于200");
				}
			}
			if(checkPageIndex.getWorkUnitPhone() != null){
				if(checkPageIndex.getWorkUnitPhone().length() > 40){
					addErrorDesc(errorDesc,"工作单位电话长度不应大于40");
				}
			}
			if(checkPageIndex.getWorkUnitPostCode() != null){
				if(checkPageIndex.getWorkUnitPostCode().length() > 6){
					addErrorDesc(errorDesc,"工作单位邮政编码长度不应大于6");
				}
			}
			if(checkPageIndex.getRegisteredAddress() != null){
				if(checkPageIndex.getRegisteredAddress().length() > 200){
					addErrorDesc(errorDesc,"户口地址长度不应大于200");
				}
			}
			if(checkPageIndex.getRegisteredAddressPostCode()!= null){
				if(checkPageIndex.getRegisteredAddressPostCode().length() > 6){
					addErrorDesc(errorDesc,"户口地址邮政编码长度不应大于6");
				}
			}
			if(checkPageIndex.getLinkManName()== null){
				addErrorDesc(errorDesc,"联系人姓名不应为空");
			}else{
				if(checkPageIndex.getLinkManName().length() > 40){
					addErrorDesc(errorDesc,"联系人姓名长度不应大于40");
				}
			}

			if(checkPageIndex.getLinkManRelativeRelationName()== null){
				addErrorDesc(errorDesc,"联系人关系不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC033");
				query.setName(checkPageIndex.getLinkManRelativeRelationName());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"联系人关系:"+query.getName()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getLinkManAddress() == null){
				addErrorDesc(errorDesc,"联系人地址不应为空");
			}else{
				if(checkPageIndex.getLinkManAddress().length() > 200){
					addErrorDesc(errorDesc,"联系人地址长度不应大于200");
				}
			}
			if(checkPageIndex.getInHospitalTypeCode()== null){
				addErrorDesc(errorDesc,"入院途径不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC026");
				query.setCode(checkPageIndex.getInHospitalTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"入院途径:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getLinkManPhone() == null){
				addErrorDesc(errorDesc,"联系人电话不应为空");
			}else{
				if(checkPageIndex.getLinkManPhone().length() > 30){
					addErrorDesc(errorDesc,"联系人电话长度不应大于30");
				}
			}
			if(checkPageIndex.getInHospitalDateTime() == null){
				addErrorDesc(errorDesc,"入院时间不应为空");
			}

			if(checkPageIndex.getInDeptCode() == null){
				addErrorDesc(errorDesc,"入院科别不应为空");
			}else{
				/*
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC023");
				query.setName(checkPageIndex.getInDeptCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"入院科别:"+query.getName()+",不在值域范围参考"+query.getTableCode()+"内");
				}*/
			}
			if(checkPageIndex.getInHospitalHouseName()!=null){
				if(checkPageIndex.getInHospitalHouseName().length() > 30){
					addErrorDesc(errorDesc,"入院病室长度不应大于30");
				}
			}

			/*if(checkPageIndex.getInHospitalHouseName()== null){
				addErrorDesc(errorDesc,"入院病室不应为空");
			}else{
				if(checkPageIndex.getInHospitalHouseName().length() > 30){
					addErrorDesc(errorDesc,"入院病室长度不应大于30");
				}
			}*/
			if(checkPageIndex.getChangeDeptCodes()!=null){
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC023");
				String[] changeDeptCodes = checkPageIndex.getChangeDeptCodes().split(",");
				for (String changeDeptCode : changeDeptCodes) {
					query.setCode(changeDeptCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"转科科别:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}*/

			}
			if(checkPageIndex.getOutHospitalDateTime() == null){
				addErrorDesc(errorDesc,"出院时间不应为空");
			}
			if(checkPageIndex.getOutDeptCode() == null){
				addErrorDesc(errorDesc,"出院科别不应为空");
			}else{
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC023");
				query.setName(checkPageIndex.getOutDeptCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"出院科别:"+query.getName()+",不在值域范围参考"+query.getTableCode()+"内");
				}*/
			}
			if(checkPageIndex.getOutHospitalHouseName()!= null){
				if(checkPageIndex.getOutHospitalHouseName().length() > 30){
					addErrorDesc(errorDesc,"出院病室长度不应大于30");
				}
			}
			/*if(checkPageIndex.getOutHospitalHouseName()== null){
				addErrorDesc(errorDesc,"出院病室不应为空");
			}else{
				if(checkPageIndex.getOutHospitalHouseName().length() > 30){
					addErrorDesc(errorDesc,"出院病室长度不应大于30");
				}
			}*/
			if(checkPageIndex.getInHospitalDayNumber() == null){
				addErrorDesc(errorDesc,"实际住院天数不应为空");
			}else{
				if(checkPageIndex.getInHospitalDayNumber()> 999999 || checkPageIndex.getInHospitalDayNumber() <=0){
					addErrorDesc(errorDesc,"实际住院天数为大于0的6位数字");
				}
			}
			List<String> allDiagCodePrefixs = new ArrayList<String>();
			List<String> allDiagCodes = new ArrayList<String>();
			Map<String,Integer> otherDiagRepeatCodes = new HashMap<String, Integer>();
			String diagCodeError = "未采用疾病分类代码国家临床版2.0疾病诊断编码（ICD-10）";
			String diagNameError = "未采用疾病分类代码国家临床版2.0疾病诊断编码（ICD-10）与编码对应的诊断名称";
			String outpatientDiagRefName = null;
			if(checkPageIndex.getOutpatientDiagCode()== null){
				addErrorDesc(errorDesc,"门（急）诊诊断编码不应为空");
			}else{
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOutpatientDiagCode());
				List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"门（急）诊诊断编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOutpatientDiagCode().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOutpatientDiagCode().substring(0, 3));
					}

					outpatientDiagRefName = (String)refDatas.get(0).get("name");
				}*/
				allDiagCodes.add(checkPageIndex.getOutpatientDiagCode());
			}
			if(checkPageIndex.getOutpatientDiagName()== null){
				addErrorDesc(errorDesc,"门（急）诊诊断描述不应为空");
			}else{
				if(outpatientDiagRefName!=null){
					if(!outpatientDiagRefName.equalsIgnoreCase(checkPageIndex.getOutpatientDiagName())){
						addErrorDesc(errorDesc,"门（急）诊诊断描述:"+checkPageIndex.getOutpatientDiagName()+","+diagNameError);
					}
				}
			}
			if(checkPageIndex.getInHospitalingStateCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC004");
				query.setCode(checkPageIndex.getInHospitalingStateCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"入院时情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			String inHospitalDiagRefName = null;
			if(checkPageIndex.getInHospitalDiagCode()!= null){
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getInHospitalDiagCode());
				List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"入院诊断编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getInHospitalDiagCode().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getInHospitalDiagCode().substring(0, 3));
					}

					inHospitalDiagRefName = (String)refDatas.get(0).get("name");
				}*/
				allDiagCodes.add(checkPageIndex.getInHospitalDiagCode());
			}
			if(checkPageIndex.getInHospitalDiagName()!= null){
				if(inHospitalDiagRefName!=null){
					if(!inHospitalDiagRefName.equalsIgnoreCase(checkPageIndex.getInHospitalDiagName())){
						addErrorDesc(errorDesc,"入院诊断诊断描述:"+checkPageIndex.getInHospitalDiagName()+","+diagNameError);
					}
				}
			}

			List<String> diagTreatResultCodes = new ArrayList<String>();
			String mainDiagRefName = null;
			if(checkPageIndex.getMainDiagCode()== null){
				addErrorDesc(errorDesc,"主要诊断编码不应为空");
			}else{
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getMainDiagCode());
				List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"主要诊断编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getMainDiagCode().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getMainDiagCode().substring(0, 3));
					}
					mainDiagRefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getMainDiagCode());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getMainDiagCode());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getMainDiagCode(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getMainDiagCode(), count);
				}
			}
			if(checkPageIndex.getMainDiagName()== null){
				addErrorDesc(errorDesc,"主要诊断编码不应为空");
			}else{
				if(mainDiagRefName!=null){
					if(!mainDiagRefName.equalsIgnoreCase(checkPageIndex.getMainDiagName())){
						addErrorDesc(errorDesc,"主要诊断诊断描述:"+checkPageIndex.getMainDiagName()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getMainDiagAdmissionConditionCode()== null){
				addErrorDesc(errorDesc,"主要诊断入院病情不应为空");
			}else{PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getMainDiagAdmissionConditionCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"主要诊断入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getMainDiagTreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getMainDiagTreatResultCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"主要诊断出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getMainDiagTreatResultCode());
				}
			}

			String otherDiag1RefName = null;
			if(checkPageIndex.getOtherDiag1Code()!= null){
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag1Code());
				List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断1编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag1Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag1Code().substring(0, 3));
					}
					otherDiag1RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag1Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag1Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag1Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag1Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag1Name()!= null){
				if(otherDiag1RefName!=null){
					if(!otherDiag1RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag1Name())){
						addErrorDesc(errorDesc,"其他诊断1诊断描述:"+checkPageIndex.getOtherDiag1Name()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getOtherDiag1AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag1AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断1入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}

			}

			if(checkPageIndex.getOtherDiag1TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag1TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断1出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag1TreatResultCode());
				}
			}

			String otherDiag2RefName = null;
			if(checkPageIndex.getOtherDiag2Code()!= null){
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag2Code());
				List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断2编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag2Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag2Code().substring(0, 3));
					}
					otherDiag2RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag2Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag2Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag2Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag2Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag2Name()!= null){
				if(otherDiag2RefName!=null){
					if(!otherDiag2RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag2Name())){
						addErrorDesc(errorDesc,"其他诊断2诊断描述:"+checkPageIndex.getOtherDiag2Name()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getOtherDiag2AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag2AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断2入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getOtherDiag2TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag2TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断2出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag2TreatResultCode());
				}
			}

			String otherDiag3RefName = null;
			if(checkPageIndex.getOtherDiag3Code()!= null){
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag3Code());
				List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断3编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag3Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag3Code().substring(0, 3));
					}
					otherDiag3RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag3Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag3Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag3Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag3Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag3Name()!= null){
				if(otherDiag3RefName!=null){
					if(!otherDiag3RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag3Name())){
						addErrorDesc(errorDesc,"其他诊断3诊断描述:"+checkPageIndex.getOtherDiag3Name()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getOtherDiag3AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag3AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断3入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getOtherDiag3TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag3TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断3出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag3TreatResultCode());
				}
			}

			String otherDiag4RefName = null;
			if(checkPageIndex.getOtherDiag4Code()!= null){
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag4Code());
				List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断4编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag4Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag4Code().substring(0, 3));
					}
					otherDiag4RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag4Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag4Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag4Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag4Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag4Name()!= null){
				if(otherDiag4RefName!=null){
					if(!otherDiag4RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag4Name())){
						addErrorDesc(errorDesc,"其他诊断4诊断描述:"+checkPageIndex.getOtherDiag4Name()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getOtherDiag4AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag4AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断4入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getOtherDiag4TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag4TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断4出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag4TreatResultCode());
				}
			}

			String otherDiag5RefName = null;
			if(checkPageIndex.getOtherDiag5Code()!= null){
				/*PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag5Code());
				List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断5编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag5Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag5Code().substring(0, 3));
					}
					otherDiag5RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag5Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag5Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag5Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag5Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag5Name()!= null){
				if(otherDiag5RefName!=null){
					if(!otherDiag5RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag5Name())){
						addErrorDesc(errorDesc,"其他诊断5诊断描述:"+checkPageIndex.getOtherDiag5Name()+","+diagNameError);
					}
				}
			}
			if(checkPageIndex.getOtherDiag5AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag5AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断5入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getOtherDiag5TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag5TreatResultCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断5出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag5TreatResultCode());
				}
			}
			String otherDiag6RefName = null;
			if(checkPageIndex.getOtherDiag6Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag6Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断6编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag6Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag6Code().substring(0, 3));
					}
					otherDiag6RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag6Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag6Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag6Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag6Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag6Name()!= null){
				if(otherDiag6RefName!=null){
					if(!otherDiag6RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag6Name())){
						addErrorDesc(errorDesc,"其他诊断6诊断描述:"+checkPageIndex.getOtherDiag6Name()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getOtherDiag6AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag6AdmissionConditionCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断6入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getOtherDiag6TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag6TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断6出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag6TreatResultCode());
				}
			}

			String otherDiag7RefName = null;
			if(checkPageIndex.getOtherDiag7Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag7Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){

					addErrorDesc(errorDesc,"其他诊断7编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag7Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag7Code().substring(0, 3));
					}
					otherDiag7RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag7Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag7Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag7Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag7Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag7Name()!= null){
				if(otherDiag7RefName!=null){
					if(!otherDiag7RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag7Name())){
						addErrorDesc(errorDesc,"其他诊断7诊断描述:"+checkPageIndex.getOtherDiag7Name()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getOtherDiag7AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag7AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断7入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getOtherDiag7TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag7TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断7出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag7TreatResultCode());
				}

			}

			String otherDiag8RefName = null;
			if(checkPageIndex.getOtherDiag8Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag8Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断8编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag8Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag8Code().substring(0, 3));
					}
					otherDiag8RefName = (String)refDatas.get(0).get("name");
				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag8Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag8Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag8Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag8Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag8Name()!= null){
				if(otherDiag8RefName!=null){
					if(!otherDiag8RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag8Name())){
						addErrorDesc(errorDesc,"其他诊断8诊断描述:"+checkPageIndex.getOtherDiag8Name()+","+diagNameError);
					}
				}
			}
			if(checkPageIndex.getOtherDiag8AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag8AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断8入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}

			}

			if(checkPageIndex.getOtherDiag8TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag8TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断8出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag8TreatResultCode());
				}
			}

			String otherDiag9RefName = null;
			if(checkPageIndex.getOtherDiag9Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag9Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断9编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag9Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag9Code().substring(0, 3));
					}
					otherDiag9RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag9Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag9Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag9Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag9Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag9Name()!= null){
				if(otherDiag9RefName!=null){
					if(!otherDiag9RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag9Name())){
						addErrorDesc(errorDesc,"其他诊断9诊断描述:"+checkPageIndex.getOtherDiag9Name()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getOtherDiag9AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag9AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断9入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getOtherDiag9TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag9TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断9出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag9TreatResultCode());
				}
			}

			String otherDiag10RefName = null;
			if(checkPageIndex.getOtherDiag10Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getOtherDiag10Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断10编码:"+query.getCode()+","+diagCodeError);
				}else{
					if(checkPageIndex.getOtherDiag10Code().length() > 3){
						allDiagCodePrefixs.add(checkPageIndex.getOtherDiag10Code().substring(0, 3));
					}
					otherDiag10RefName = (String)refDatas.get(0).get("name");

				}*/
				allDiagCodes.add(checkPageIndex.getOtherDiag10Code());
				Integer count = otherDiagRepeatCodes.get(checkPageIndex.getOtherDiag10Code());
				if(count !=null){
					count++;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag10Code(), count);
				}else{
					count=1;
					otherDiagRepeatCodes.put(checkPageIndex.getOtherDiag10Code(), count);
				}
			}
			if(checkPageIndex.getOtherDiag10Name()!= null){
				if(otherDiag10RefName!=null){
					if(!otherDiag10RefName.equalsIgnoreCase(checkPageIndex.getOtherDiag10Name())){
						addErrorDesc(errorDesc,"其他诊断10诊断描述:"+checkPageIndex.getOtherDiag10Name()+","+diagNameError);
					}
				}
			}

			if(checkPageIndex.getOtherDiag10AdmissionConditionCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC027");
				query.setCode(checkPageIndex.getOtherDiag10AdmissionConditionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断10入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDectPageIndexRefs(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"其他诊断10入院病情:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}*/
			}

			if(checkPageIndex.getOtherDiag10TreatResultCode()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC005");
				query.setCode(checkPageIndex.getOtherDiag10TreatResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"其他诊断10出院情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}else{
					diagTreatResultCodes.add(checkPageIndex.getOtherDiag10TreatResultCode());
				}
			}

			if(checkPageIndex.getInfectionTotalTimes() != null){
				if(checkPageIndex.getInfectionTotalTimes().intValue() > 99999){
					addErrorDesc(errorDesc,"医院感染总次数长度不应大于5");
				}else if(checkPageIndex.getInfectionTotalTimes().intValue() <0){
					addErrorDesc(errorDesc,"医院感染总次数应为不于0的整数");
				}
			}

			String pathologyDiagCodeError = "采用疾病分类代码国家临床版2.0肿瘤学态学编码（M码）";
			String pathologyDiagNameError = "采用疾病分类代码国家临床版2.0肿瘤学态学编码（M码）与编码对应的病理名称";

			String pathologyDiag1RefName = null;
			if(checkPageIndex.getPathologyDiag1Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getPathologyDiag1Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"病理诊断1编码:"+query.getCode()+","+pathologyDiagCodeError);
				}else{
					pathologyDiag1RefName = (String)refDatas.get(0).get("name");
				}*/
			}
			if(checkPageIndex.getPathologyDiag1Name()!= null){
				if(pathologyDiag1RefName!=null){
					if(!pathologyDiag1RefName.equalsIgnoreCase(checkPageIndex.getPathologyDiag1Name())){
						addErrorDesc(errorDesc,"病理诊断1诊断描述:"+checkPageIndex.getPathologyDiag1Name()+","+pathologyDiagNameError);
					}
				}
			}
			if(checkPageIndex.getPathologyNumber1()!= null){
				if(checkPageIndex.getPathologyNumber1().length() > 50){
					addErrorDesc(errorDesc,"病理号1长度不应大于50");
				}
			}

			String pathologyDiag2RefName = null;
			if(checkPageIndex.getPathologyDiag2Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getPathologyDiag2Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"病理诊断2编码:"+query.getCode()+","+pathologyDiagCodeError);
				}else{
					pathologyDiag2RefName = (String)refDatas.get(0).get("name");
				}*/
			}
			if(checkPageIndex.getPathologyDiag2Name()!= null){
				if(pathologyDiag2RefName!=null){
					if(!pathologyDiag2RefName.equalsIgnoreCase(checkPageIndex.getPathologyDiag2Name())){
						addErrorDesc(errorDesc,"病理诊断2诊断描述:"+checkPageIndex.getPathologyDiag2Name()+","+pathologyDiagNameError);
					}
				}
			}
			if(checkPageIndex.getPathologyNumber2()!= null){
				if(checkPageIndex.getPathologyNumber2().length() > 50){
					addErrorDesc(errorDesc,"病理号2长度不应大于50");
				}
			}

			String pathologyDiag3RefName = null;
			if(checkPageIndex.getPathologyDiag3Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getPathologyDiag3Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"病理诊断3编码:"+query.getCode()+","+pathologyDiagCodeError);
				}else{
					pathologyDiag3RefName = (String)refDatas.get(0).get("name");
				}*/
			}
			if(checkPageIndex.getPathologyDiag3Name()!= null){
				if(pathologyDiag3RefName!=null){
					if(!pathologyDiag3RefName.equalsIgnoreCase(checkPageIndex.getPathologyDiag3Name())){
						addErrorDesc(errorDesc,"病理诊断3诊断描述:"+checkPageIndex.getPathologyDiag3Name()+","+pathologyDiagNameError);
					}
				}
			}
			if(checkPageIndex.getPathologyNumber3()!= null){
				if(checkPageIndex.getPathologyNumber3().length() > 50){
					addErrorDesc(errorDesc,"病理号1长度不应大于50");
				}
			}

			String damageAndVenenationDiag1RefName = null;
			if(checkPageIndex.getDamageAndVenenationDiag1Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getDamageAndVenenationDiag1Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素1编码:"+query.getCode()+","+diagCodeError);
				}else{
					damageAndVenenationDiag1RefName = (String)refDatas.get(0).get("name");
				}*/
			}
			if(checkPageIndex.getDamageAndVenenationDiag1Name()!= null){
				if(damageAndVenenationDiag1RefName!=null){
					if(!damageAndVenenationDiag1RefName.equalsIgnoreCase(checkPageIndex.getDamageAndVenenationDiag1Name())){
						addErrorDesc(errorDesc,"损伤、中毒的外部因素1描述:"+checkPageIndex.getDamageAndVenenationDiag1Name()+","+diagNameError);
					}
				}
			}

			String damageAndVenenationDiag2RefName = null;
			if(checkPageIndex.getDamageAndVenenationDiag2Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getDamageAndVenenationDiag2Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素2编码:"+query.getCode()+","+diagCodeError);
				}else{
					damageAndVenenationDiag2RefName = (String)refDatas.get(0).get("name");
				}*/
			}
			if(checkPageIndex.getDamageAndVenenationDiag2Name()!= null){
				if(damageAndVenenationDiag2RefName!=null){
					if(!damageAndVenenationDiag2RefName.equalsIgnoreCase(checkPageIndex.getDamageAndVenenationDiag2Name())){
						addErrorDesc(errorDesc,"损伤、中毒的外部因素2描述:"+checkPageIndex.getDamageAndVenenationDiag2Name()+","+diagNameError);
					}
				}
			}

			String damageAndVenenationDiag3RefName = null;
			if(checkPageIndex.getDamageAndVenenationDiag3Code()!= null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getDamageAndVenenationDiag3Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdDiseasePageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素3编码:"+query.getCode()+","+diagCodeError);
				}else{
					damageAndVenenationDiag3RefName = (String)refDatas.get(0).get("name");
				}*/
			}
			if(checkPageIndex.getDamageAndVenenationDiag3Name()!= null){
				if(damageAndVenenationDiag3RefName!=null){
					if(!damageAndVenenationDiag3RefName.equalsIgnoreCase(checkPageIndex.getDamageAndVenenationDiag3Name())){
						addErrorDesc(errorDesc,"损伤、中毒的外部因素3描述:"+checkPageIndex.getDamageAndVenenationDiag3Name()+","+diagNameError);
					}
				}
			}
			if(checkPageIndex.getAllergySourceCodes() != null){
				String[] allergySourceCodes = checkPageIndex.getAllergySourceCodes().split(",");
				for (String allergySourceCode : allergySourceCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC006");
					query.setCode(allergySourceCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"过敏源:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getAllergyDrugNames()!= null){
				if(checkPageIndex.getAllergyDrugNames().length() > 100){
					addErrorDesc(errorDesc,"过敏药物长度不应大于100");
				}
			}
			if(checkPageIndex.getHbsAgResultCode() != null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC007");
				query.setCode(checkPageIndex.getHbsAgResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"HBsAg:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getHcvAbResultCode() != null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC007");
				query.setCode(checkPageIndex.getHcvAbResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"HCV-Ab:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getHivAbResultCode() != null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC007");
				query.setCode(checkPageIndex.getHivAbResultCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"HCV-Ab:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getDiagAccordA01CompareCode() != null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC008");
				query.setCode(checkPageIndex.getDiagAccordA01CompareCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"门诊与出院诊断符合情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getDiagAccordA02CompareCode() != null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC008");
				query.setCode(checkPageIndex.getDiagAccordA02CompareCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"入院与出院诊断符合情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getDiagAccordA03CompareCode() != null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC008");
				query.setCode(checkPageIndex.getDiagAccordA03CompareCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"术前与术后诊断符合情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getDiagAccordA04CompareCode() != null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC008");
				query.setCode(checkPageIndex.getDiagAccordA04CompareCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"临床与病理诊断符合情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getDiagAccordA05CompareCode() != null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC008");
				query.setCode(checkPageIndex.getDiagAccordA05CompareCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"放射与病理诊断符合情况:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getRescueTimes()!=null){
				if(checkPageIndex.getRescueTimes().intValue() > 999){
					addErrorDesc(errorDesc,"抢救次数长度不应大于3");
				}else if(checkPageIndex.getRescueTimes().intValue() <0){
					addErrorDesc(errorDesc,"抢救次数应为不小于0的整数");
				}
			}
			if(checkPageIndex.getRescueSucceedTimes()!=null){
				if(checkPageIndex.getRescueSucceedTimes().intValue() > 999){
					addErrorDesc(errorDesc,"抢救成功次数长度不应大于3");
				}else if(checkPageIndex.getRescueSucceedTimes().intValue() <0){
					addErrorDesc(errorDesc,"抢救成功次数应为不小于0的整数");
				}
			}
			if(checkPageIndex.getMalignantTumorHighestDiagBasisCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC009");
				query.setCode(checkPageIndex.getMalignantTumorHighestDiagBasisCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"最高诊断依据:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getMalignantTumorDifferentDegreeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC010");
				query.setCode(checkPageIndex.getMalignantTumorDifferentDegreeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"分化程度:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getA1001DoctorName()== null){
				addErrorDesc(errorDesc,"科主任不应为空");
			}else{
				if(checkPageIndex.getA1001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"科主任长度不应大于40");
				}
			}

			if(checkPageIndex.getA2001DoctorName()== null){
				addErrorDesc(errorDesc,"主（副主）任医师不应为空");
			}else{
				if(checkPageIndex.getA2001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"主（副主）任医师长度不应大于40");
				}
			}

			if(checkPageIndex.getA2003DoctorName()== null){
				addErrorDesc(errorDesc,"主治医师不应为空");
			}else{
				if(checkPageIndex.getA2003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"主治医师长度不应大于40");
				}
			}

			if(checkPageIndex.getA2005DoctorName()== null){
				addErrorDesc(errorDesc,"住院医师不应为空");
			}else{
				if(checkPageIndex.getA2005DoctorName().length() > 40){
					addErrorDesc(errorDesc,"住院医师长度不应大于40");
				}
			}


			if(checkPageIndex.getA3001DoctorName()!= null){
				if(checkPageIndex.getA3001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"责任护士长度不应大于40");
				}
			}
			if(checkPageIndex.getA2006DoctorName()!= null){
				if(checkPageIndex.getA2006DoctorName().length() > 40){
					addErrorDesc(errorDesc,"进修医师长度不应大于40");
				}
			}
			if(checkPageIndex.getA2007DoctorName()!= null){
				if(checkPageIndex.getA2007DoctorName().length() > 40){
					addErrorDesc(errorDesc,"研究生实习医师长度不应大于40");
				}
			}
			if(checkPageIndex.getA2008DoctorName()!= null){
				if(checkPageIndex.getA2008DoctorName().length() > 40){
					addErrorDesc(errorDesc,"实习医师长度不应大于40");
				}
			}
			if(checkPageIndex.getA4001DoctorName()== null){
				addErrorDesc(errorDesc,"编码员不应为空");
			}else{
				if(checkPageIndex.getA4001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"编码员长度不应大于40");
				}
			}
			if(checkPageIndex.getMedicalRecordQualityCode()== null){
				addErrorDesc(errorDesc,"病案质量不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC011");
				query.setCode(checkPageIndex.getMedicalRecordQualityCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"病案质量:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getA2009DoctorName()== null){
				addErrorDesc(errorDesc,"质控医师不应为空");
			}else{
				if(checkPageIndex.getA2009DoctorName().length() > 40){
					addErrorDesc(errorDesc,"质控医师长度不应大于40");
				}
			}
			if(checkPageIndex.getA3003DoctorName()!= null){
				if(checkPageIndex.getA3003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"质控护师长度不应大于40");
				}
			}
			if(checkPageIndex.getQualityControlDateTime()==null){
				addErrorDesc(errorDesc,"质控日期不应为空");
			}
			String surgeryCodeError = "未采用手术操作分类代码国家临床版2.0手术操作编码（ICD-9-CM3）";
			String surgeryNameError = "未采用手术操作分类代码国家临床版2.0手术操作编码（ICD-9-CM3）对应的名称。";
			String surgery1RefName = null;
			if(checkPageIndex.getSurgery1Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery1Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码1编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery1RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery1Name()!= null){
				if(surgery1RefName!=null){
					if(!surgery1RefName.equalsIgnoreCase(checkPageIndex.getSurgery1Name())){
						addErrorDesc(errorDesc,"手术/操作编码1名称:"+checkPageIndex.getSurgery1Name()+","+surgeryNameError);
					}
				}
			}
			if(checkPageIndex.getSurgery1LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery1LevelCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别1:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery1BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery1BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位1:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}

			if(checkPageIndex.getSurgery1DurationTime() != null){
				if(checkPageIndex.getSurgery1DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间1 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery1DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间1 应为不小于0");
				}
			}

			if(checkPageIndex.getSurgery1A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery1A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者1长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery1A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery1A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助1长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery1A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery1A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助1长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery1AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery1AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式1:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery1AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery1AnaesthesiaLevelCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级1:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery1IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery1IncisionCicatrizeLevelCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级1:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery1A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery1A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师1长度不应大于40");
				}
			}

			String surgery2RefName = null;
			if(checkPageIndex.getSurgery2Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery2Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码2编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery2RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery2Name()!= null){
				if(surgery2RefName!=null){
					if(!surgery2RefName.equalsIgnoreCase(checkPageIndex.getSurgery2Name())){
						addErrorDesc(errorDesc,"手术/操作编码2名称:"+checkPageIndex.getSurgery2Name()+","+surgeryNameError);
					}
				}
			}

			if(checkPageIndex.getSurgery2LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery2LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别2:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getSurgery2BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery2BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);

					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位2:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getSurgery2DurationTime() != null){
				if(checkPageIndex.getSurgery2DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间2 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery2DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间2 应为不小于0");
				}
			}
			if(checkPageIndex.getSurgery2A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery2A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者2长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery2A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery2A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助2长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery2A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery2A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助2长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery2AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery2AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式2:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery2AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery2AnaesthesiaLevelCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级2:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery2IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery2IncisionCicatrizeLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级2:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery2A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery2A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师2长度不应大于40");
				}
			}
			String surgery3RefName = null;
			if(checkPageIndex.getSurgery3Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery3Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码3编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery3RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery3Name()!= null){
				if(surgery3RefName!=null){
					if(!surgery3RefName.equalsIgnoreCase(checkPageIndex.getSurgery3Name())){
						addErrorDesc(errorDesc,"手术/操作编码3名称:"+checkPageIndex.getSurgery3Name()+","+surgeryNameError);
					}
				}
			}

			if(checkPageIndex.getSurgery3LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery3LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别3:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getSurgery3BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery3BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位3:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getSurgery3DurationTime() != null){
				if(checkPageIndex.getSurgery3DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间3 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery3DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间3 应为不小于0");
				}
			}
			if(checkPageIndex.getSurgery3A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery3A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者3长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery3A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery3A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助3长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery3A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery3A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助1长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery3AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery3AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式3:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery3AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery3AnaesthesiaLevelCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级3:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery3IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery3IncisionCicatrizeLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级3:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery3A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery3A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师3长度不应大于40");
				}
			}

			String surgery4RefName = null;
			if(checkPageIndex.getSurgery4Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery4Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码4编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery4RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery4Name()!= null){
				if(surgery4RefName!=null){
					if(!surgery4RefName.equalsIgnoreCase(checkPageIndex.getSurgery4Name())){
						addErrorDesc(errorDesc,"手术/操作编码4名称:"+checkPageIndex.getSurgery4Name()+","+surgeryNameError);
					}
				}
			}
			if(checkPageIndex.getSurgery4LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery4LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别4:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getSurgery4BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery4BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位4:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getSurgery4DurationTime() != null){
				if(checkPageIndex.getSurgery4DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间4 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery4DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间4 应为不小于0");
				}
			}
			if(checkPageIndex.getSurgery4A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery4A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者4长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery4A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery4A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助4长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery4A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery4A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助4长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery4AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery4AnaesthesiaTypeCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式4:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery4AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery4AnaesthesiaLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级4:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}

			}
			if(checkPageIndex.getSurgery4IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery4IncisionCicatrizeLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级4:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery4A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery4A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师4长度不应大于40");
				}
			}
			String surgery5RefName = null;
			if(checkPageIndex.getSurgery5Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery5Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码5编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery5RefName = (String)refDatas.get(0).get("name");
				}*/
			}
			if(checkPageIndex.getSurgery5Name()!= null){
				if(surgery5RefName!=null){
					if(!surgery5RefName.equalsIgnoreCase(checkPageIndex.getSurgery5Name())){
						addErrorDesc(errorDesc,"手术/操作编码5名称:"+checkPageIndex.getSurgery5Name()+","+surgeryNameError);
					}
				}
			}

			if(checkPageIndex.getSurgery5LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery5LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别5:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery5DurationTime() != null){
				if(checkPageIndex.getSurgery5DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间5 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery5DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间5 应为不小于0");
				}
			}
			if(checkPageIndex.getSurgery5BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery5BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位5:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getSurgery5A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery5A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者5长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery5A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery5A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助5长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery5A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery5A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助5长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery5AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery5AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式5:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery5AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery5AnaesthesiaLevelCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级5:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery5IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery5IncisionCicatrizeLevelCode());

				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级5:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery5A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery5A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师5长度不应大于40");
				}
			}
			String surgery6RefName = null;
			if(checkPageIndex.getSurgery6Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery6Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码6编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery6RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery6Name()!= null){
				if(surgery6RefName!=null){
					if(!surgery6RefName.equalsIgnoreCase(checkPageIndex.getSurgery6Name())){
						addErrorDesc(errorDesc,"手术/操作编码6名称:"+checkPageIndex.getSurgery6Name()+","+surgeryNameError);
					}
				}
			}

			if(checkPageIndex.getSurgery6LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery6LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别6:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getSurgery6BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery6BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);

					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位6:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getSurgery6DurationTime() != null){
				if(checkPageIndex.getSurgery6DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间6 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery2DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间6 应为不小于0");
				}
			}

			if(checkPageIndex.getSurgery6A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery6A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者1长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery6A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery6A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助6长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery6A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery6A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助6长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery6AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery6AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式6:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery6AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery6AnaesthesiaLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级6:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery6IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery6IncisionCicatrizeLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级6:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery6A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery6A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师6长度不应大于40");
				}
			}
			String surgery7RefName = null;
			if(checkPageIndex.getSurgery7Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery7Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码7编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery7RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery7Name()!= null){
				if(surgery7RefName!=null){
					if(!surgery7RefName.equalsIgnoreCase(checkPageIndex.getSurgery7Name())){
						addErrorDesc(errorDesc,"手术/操作编码7名称:"+checkPageIndex.getSurgery7Name()+","+surgeryNameError);
					}
				}
			}

			if(checkPageIndex.getSurgery7LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery7LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别7:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getSurgery7BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery7BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位7:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getSurgery7DurationTime() != null){
				if(checkPageIndex.getSurgery7DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间7 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery7DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间7 应为不小于0");
				}
			}

			if(checkPageIndex.getSurgery7A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery7A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者7长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery7A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery7A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助7长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery7A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery7A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助7长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery7AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery7AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式7:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery7AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery7AnaesthesiaLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级7:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery7IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery7IncisionCicatrizeLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级7:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery7A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery7A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师7长度不应大于40");
				}
			}
			String surgery8RefName = null;
			if(checkPageIndex.getSurgery8Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery8Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码8编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery8RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery8Name()!= null){
				if(surgery8RefName!=null){
					if(!surgery8RefName.equalsIgnoreCase(checkPageIndex.getSurgery8Name())){
						addErrorDesc(errorDesc,"手术/操作编码8名称:"+checkPageIndex.getSurgery8Name()+","+surgeryNameError);
					}
				}
			}

			if(checkPageIndex.getSurgery8LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery8LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别8:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getSurgery8BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery8BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位8:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getSurgery8DurationTime() != null){
				if(checkPageIndex.getSurgery8DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间8 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery8DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间8 应为不小于0");
				}
			}
			if(checkPageIndex.getSurgery8A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery8A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者8长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery8A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery8A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助8长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery8A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery8A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助8长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery8AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery8AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式8:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery8AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery8AnaesthesiaLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级8:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery8IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery8IncisionCicatrizeLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级8:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery8A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery8A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师8长度不应大于40");
				}
			}
			String surgery9RefName = null;
			if(checkPageIndex.getSurgery9Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery9Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码9编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery9RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery9Name()!= null){
				if(surgery9RefName!=null){
					if(!surgery9RefName.equalsIgnoreCase(checkPageIndex.getSurgery9Name())){
						addErrorDesc(errorDesc,"手术/操作编码9名称:"+checkPageIndex.getSurgery9Name()+","+surgeryNameError);
					}
				}
			}
			if(checkPageIndex.getSurgery9LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery9LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别9:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getSurgery9BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery9BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位9:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}

			if(checkPageIndex.getSurgery9DurationTime() != null){
				if(checkPageIndex.getSurgery9DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间9 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery9DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间9 应为不小于0");
				}
			}
			if(checkPageIndex.getSurgery9A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery9A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者9长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery9A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery9A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助9长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery9A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery9A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助9长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery9AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery9AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式9:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery9AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery9AnaesthesiaLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级9:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery9IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery9IncisionCicatrizeLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级9:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery9A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery9A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师9长度不应大于40");
				}
			}
			String surgery10RefName = null;
			if(checkPageIndex.getSurgery10Code()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setCode(checkPageIndex.getSurgery10Code());
				/*List<Map<String,Object>> refDatas = baseInfoMapper.getStdSurgeryPageIndexRef(query);
				if(refDatas.isEmpty()){
					addErrorDesc(errorDesc,"手术/操作编码10编码:"+query.getCode()+","+surgeryCodeError);
				}else{
					surgery10RefName = (String)refDatas.get(0).get("name");
				}*/
			}

			if(checkPageIndex.getSurgery10Name()!= null){
				if(surgery10RefName!=null){
					if(!surgery10RefName.equalsIgnoreCase(checkPageIndex.getSurgery10Name())){
						addErrorDesc(errorDesc,"手术/操作编码10名称:"+checkPageIndex.getSurgery10Name()+","+surgeryNameError);
					}
				}
			}

			if(checkPageIndex.getSurgery10LevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC029");
				query.setCode(checkPageIndex.getSurgery10LevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术级别10:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getSurgery10BodyPartCodes()!=null){
				String[] surgeryBodyPartCodes = checkPageIndex.getSurgery10BodyPartCodes().split(",");
				for (String surgeryBodyPartCode : surgeryBodyPartCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC012");
					query.setCode(surgeryBodyPartCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术/操作部位10:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getSurgery10DurationTime() != null){
				if(checkPageIndex.getSurgery10DurationTime().intValue() > 99999){
					addErrorDesc(errorDesc,"手术持续时间10 长度不应大于(7,2)");
				}else if(checkPageIndex.getSurgery10DurationTime().intValue() <0){
					addErrorDesc(errorDesc,"手术持续时间10 应为不小于0");
				}
			}
			if(checkPageIndex.getSurgery10A5001DoctorName()!=null){
				if(checkPageIndex.getSurgery10A5001DoctorName().length() > 40){
					addErrorDesc(errorDesc,"术者10长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery10A5002DoctorName()!=null){
				if(checkPageIndex.getSurgery10A5002DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅰ助10长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery10A5003DoctorName()!=null){
				if(checkPageIndex.getSurgery10A5003DoctorName().length() > 40){
					addErrorDesc(errorDesc,"Ⅱ助10长度不应大于40");
				}
			}
			if(checkPageIndex.getSurgery10AnaesthesiaTypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC013");
				query.setCode(checkPageIndex.getSurgery10AnaesthesiaTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉方式10:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery10AnaesthesiaLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC024");
				query.setCode(checkPageIndex.getSurgery10AnaesthesiaLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"麻醉分级10:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery10IncisionCicatrizeLevelCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC014");
				query.setCode(checkPageIndex.getSurgery10IncisionCicatrizeLevelCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"切口愈合等级10:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgery10A5004DoctorName()!=null){
				if(checkPageIndex.getSurgery10A5004DoctorName().length() > 40){
					addErrorDesc(errorDesc,"麻醉医师10长度不应大于40");
				}
			}
			if(checkPageIndex.getSpecialNurseDayNumber()!=null){
				if(checkPageIndex.getSpecialNurseDayNumber().intValue() > 999999){
					addErrorDesc(errorDesc,"特级护理天数长度不应大于6");
				}else if(checkPageIndex.getSpecialNurseDayNumber().intValue() <0){
					addErrorDesc(errorDesc,"特级护理天数 应为不小于0的整数");
				}
			}

			if(checkPageIndex.getFirstLevelNurseDayNumber()!=null){
				if(checkPageIndex.getFirstLevelNurseDayNumber().intValue() > 999999){
					addErrorDesc(errorDesc,"一级护理天数长度不应大于6");
				}else if(checkPageIndex.getFirstLevelNurseDayNumber().intValue() <0){
					addErrorDesc(errorDesc,"一级护理天数 应为不小于0的整数");
				}
			}
			if(checkPageIndex.getSecondLevelNurseDayNumber()!=null){
				if(checkPageIndex.getSecondLevelNurseDayNumber().intValue() > 999999){
					addErrorDesc(errorDesc,"二级护理天数长度不应大于6");
				}else if(checkPageIndex.getSecondLevelNurseDayNumber().intValue() <0){
					addErrorDesc(errorDesc,"二级护理天数 应为不小于0的整数");
				}
			}
			if(checkPageIndex.getThirdLevelNurseDayNumber()!=null){
				if(checkPageIndex.getThirdLevelNurseDayNumber().intValue() > 999999){
					addErrorDesc(errorDesc,"三级护理天数长度不应大于6");
				}else if(checkPageIndex.getThirdLevelNurseDayNumber().intValue() <0){
					addErrorDesc(errorDesc,"三级护理天数 应为不小于0的整数");
				}
			}
			if(checkPageIndex.getIntensiveCare1TypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC015");
				query.setCode(checkPageIndex.getIntensiveCare1TypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"重症监护室名称1:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getIntensiveCare2TypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC015");
				query.setCode(checkPageIndex.getIntensiveCare2TypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"重症监护室名称2:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getIntensiveCare3TypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC015");
				query.setCode(checkPageIndex.getIntensiveCare3TypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"重症监护室名称3:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getIntensiveCare4TypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC015");
				query.setCode(checkPageIndex.getIntensiveCare4TypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"重症监护室名称4:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getIntensiveCare5TypeCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC015");
				query.setCode(checkPageIndex.getIntensiveCare5TypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"重症监护室名称5:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}

			if(checkPageIndex.getIsAutopsyCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC016");
				query.setCode(checkPageIndex.getIsAutopsyCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"死亡患者尸检:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getIsFirstCaseCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC016");
				query.setCode(checkPageIndex.getIsFirstCaseCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"手术、治疗、检查、诊断为本院第一例:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getSurgeryPatientTypeCodes()!=null){
				String[] surgeryPatientTypeCodes = checkPageIndex.getSurgeryPatientTypeCodes().split(",");
				for (String surgeryPatientTypeCode : surgeryPatientTypeCodes) {
					PageIndexRefQuery query = new PageIndexRefQuery();
					query.setTableCode("RC025");
					query.setCode(surgeryPatientTypeCode);
					if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
						addErrorDesc(errorDesc,"手术患者类型:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
					}
				}
			}
			if(checkPageIndex.getIsFollowUpClinicCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC017");
				query.setCode(checkPageIndex.getIsFollowUpClinicCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"随诊:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getFollowUpClinicWeekNumber()!= null){
				if(checkPageIndex.getFollowUpClinicWeekNumber().intValue() > 99 || checkPageIndex.getFollowUpClinicWeekNumber().intValue() <=0){
					addErrorDesc(errorDesc,"随诊周数应为数字(4,2)");
				}
			}
			if(checkPageIndex.getFollowUpClinicMonthNumber()!= null){
				if(checkPageIndex.getFollowUpClinicMonthNumber().intValue() > 99 || checkPageIndex.getFollowUpClinicMonthNumber().intValue() <=0){
					addErrorDesc(errorDesc,"随诊周数应为数字(4,2)");
				}
			}
			if(checkPageIndex.getFollowUpClinicYearNumber()!= null){
				if(checkPageIndex.getFollowUpClinicYearNumber().intValue() > 99 || checkPageIndex.getFollowUpClinicYearNumber().intValue() <=0){
					addErrorDesc(errorDesc,"随诊年数应为数字(4,2)");
				}
			}
			if(checkPageIndex.getIsTeachingCaseCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC016");
				query.setCode(checkPageIndex.getIsTeachingCaseCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"示教病例:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getBloodTypeCode()==null){
				addErrorDesc(errorDesc,"ABO血型不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC030");
				query.setCode(checkPageIndex.getBloodTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"ABO血型:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getRhBloodTypeCode()==null){
				addErrorDesc(errorDesc,"Rh血型不应为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC031");
				query.setCode(checkPageIndex.getRhBloodTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"Rh血型:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getBleedingReactionCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC018");
				query.setCode(checkPageIndex.getBleedingReactionCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"输血反应:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getRedBloodCellVolume()!= null){
				if(checkPageIndex.getRedBloodCellVolume().intValue() > 999999 || checkPageIndex.getRedBloodCellVolume().intValue() <=0){
					addErrorDesc(errorDesc,"红细胞容量应为数字(8,2)");
				}
			}
			if(checkPageIndex.getBloodPlateletVolume()!= null){
				if(checkPageIndex.getBloodPlateletVolume().intValue() > 999999 || checkPageIndex.getBloodPlateletVolume().intValue() <=0){
					addErrorDesc(errorDesc,"血小板容量应为数字(8,2)");
				}
			}
			if(checkPageIndex.getPlasmaVolume()!= null){
				if(checkPageIndex.getPlasmaVolume().intValue() > 999999 || checkPageIndex.getPlasmaVolume().intValue() <=0){
					addErrorDesc(errorDesc,"血浆容量应为数字(6)");
				}
			}
			if(checkPageIndex.getWholeBloodVolume()!= null){
				if(checkPageIndex.getWholeBloodVolume().intValue() > 999999 || checkPageIndex.getWholeBloodVolume().intValue() <=0){
					addErrorDesc(errorDesc,"全血容量应为数字(6)");
				}
			}
			if(checkPageIndex.getSelfBloodVolume()!= null){
				if(checkPageIndex.getSelfBloodVolume().intValue() > 999999 || checkPageIndex.getSelfBloodVolume().intValue() <=0){
					addErrorDesc(errorDesc,"自体回收容量应为数字(6)");
				}
			}
			if(checkPageIndex.getOtherBloodVolume()!= null){
				if(checkPageIndex.getOtherBloodVolume().intValue() > 999999 || checkPageIndex.getOtherBloodVolume().intValue() <=0){
					addErrorDesc(errorDesc,"其它血液容量应为数字(6)");
				}
			}
			if(checkPageIndex.getMonthOfAge()!= null){
				if(checkPageIndex.getMonthOfAge().floatValue() > 99 || checkPageIndex.getMonthOfAge().floatValue() <=0){
					addErrorDesc(errorDesc,"（年龄不足1周岁的）年龄(月)应为数字(4,2)");
				}
			}
			if(checkPageIndex.getBabyBirthWeight()!= null){
				if(checkPageIndex.getBabyBirthWeight().intValue() > 999999 || checkPageIndex.getBabyBirthWeight().intValue() <=0){
					addErrorDesc(errorDesc,"新生儿出生体重1(克)应为数字(6)");
				}else{
					if(checkPageIndex.getBabyBirthWeight().intValue()%10!=0){
						addErrorDesc(errorDesc,"新生儿出生体重1(克)应精确到10克");
					}
				}
			}

			if(checkPageIndex.getBaby2BirthWeight()!= null){
				if(checkPageIndex.getBaby2BirthWeight().intValue() > 999999 || checkPageIndex.getBaby2BirthWeight().intValue() <=0){
					addErrorDesc(errorDesc,"新生儿出生体重2(克)应为数字(6)");
				}else{
					if(checkPageIndex.getBaby2BirthWeight().intValue()%10!=0){
						addErrorDesc(errorDesc,"新生儿出生体重2(克)应精确到10克");
					}
				}
			}

			if(checkPageIndex.getBaby3BirthWeight()!= null){
				if(checkPageIndex.getBaby3BirthWeight().intValue() > 999999 || checkPageIndex.getBaby3BirthWeight().intValue() <=0){
					addErrorDesc(errorDesc,"新生儿出生体重3(克)应为数字(6)");
				}else{
					if(checkPageIndex.getBaby3BirthWeight().intValue()%10!=0){
						addErrorDesc(errorDesc,"新生儿出生体重3(克)应精确到10克");
					}
				}
			}
			if(checkPageIndex.getBaby4BirthWeight()!= null){
				if(checkPageIndex.getBaby4BirthWeight().intValue() > 999999 || checkPageIndex.getBaby4BirthWeight().intValue() <=0){
					addErrorDesc(errorDesc,"新生儿出生体重4(克)应为数字(6)");
				}else{
					if(checkPageIndex.getBaby4BirthWeight().intValue()%10!=0){
						addErrorDesc(errorDesc,"新生儿出生体重4(克)应精确到10克");
					}
				}
			}
			if(checkPageIndex.getBaby5BirthWeight()!= null){
				if(checkPageIndex.getBaby5BirthWeight().intValue() > 999999 || checkPageIndex.getBaby5BirthWeight().intValue() <=0){
					addErrorDesc(errorDesc,"新生儿出生体重5(克)应为数字(6)");
				}else{
					if(checkPageIndex.getBaby5BirthWeight().intValue()%10!=0){
						addErrorDesc(errorDesc,"新生儿出生体重5(克)应精确到10克");
					}
				}
			}


			if(checkPageIndex.getBabyInHospitalWeight()!= null){
				if(checkPageIndex.getBabyInHospitalWeight().intValue() > 999999 || checkPageIndex.getBabyInHospitalWeight().intValue() <=0){
					addErrorDesc(errorDesc,"新生儿入院体重(克)应为数字(6)");
				}else{
					if(checkPageIndex.getBabyInHospitalWeight().intValue()%10!=0){
						addErrorDesc(errorDesc,"新生儿入院体重(克)应精确到10克");
					}
				}
			}

			if(checkPageIndex.getHourOfBeforeInHospitalComa()!= null){
				if(checkPageIndex.getHourOfBeforeInHospitalComa().intValue() > 999999 || checkPageIndex.getHourOfBeforeInHospitalComa().intValue() <=0){
					addErrorDesc(errorDesc,"入院前颅脑昏迷(小时)应为数字(6)");
				}
			}
			if(checkPageIndex.getMinuteOfBeforeInHospitalComa()!= null){
				if(checkPageIndex.getMinuteOfBeforeInHospitalComa().intValue() > 999999 || checkPageIndex.getMinuteOfBeforeInHospitalComa().intValue() <=0){
					addErrorDesc(errorDesc,"入院前颅脑昏迷(分钟)应为数字(6)");
				}
			}
			if(checkPageIndex.getHourOfAfterInHospitalComa()!= null){
				if(checkPageIndex.getHourOfAfterInHospitalComa().intValue() > 999999 || checkPageIndex.getHourOfAfterInHospitalComa().intValue() <=0){
					addErrorDesc(errorDesc,"入院后颅脑昏迷(小时)应为数字(6)");
				}
			}
			if(checkPageIndex.getMinuteOfAfterInHospitalComa()!= null){
				if(checkPageIndex.getMinuteOfAfterInHospitalComa().intValue() > 999999 || checkPageIndex.getMinuteOfAfterInHospitalComa().intValue() <=0){
					addErrorDesc(errorDesc,"入院后颅脑昏迷(分钟)应为数字(6)");
				}
			}
			if(checkPageIndex.getMedicalVentilatorUsedHourNumber()!= null){
				if(checkPageIndex.getMedicalVentilatorUsedHourNumber().intValue() > 999999 || checkPageIndex.getMedicalVentilatorUsedHourNumber().intValue() <=0){
					addErrorDesc(errorDesc,"呼吸机使用时间(小时)应为数字(6)");
				}
			}
			if(checkPageIndex.getIsRehospitalAfter31DayPlanCode()!=null){
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC028");
				query.setCode(checkPageIndex.getIsRehospitalAfter31DayPlanCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"是否有出院31天内再住院计划:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getRehospitalAfter31DayAimName()!= null){
				if(checkPageIndex.getRehospitalAfter31DayAimName().length() > 100){
					addErrorDesc(errorDesc,"出院31天再住院计划目的长度不应大于100");
				}
			}
			if(checkPageIndex.getOutHospitalTypeCode()==null){
				addErrorDesc(errorDesc,"离院方式不能为空");
			}else{
				PageIndexRefQuery query = new PageIndexRefQuery();
				query.setTableCode("RC019");
				query.setCode(checkPageIndex.getOutHospitalTypeCode());
				if(!checkPageIndexDectStrictRef(pageIndexDectRefs,query)){
					addErrorDesc(errorDesc,"离院方式:"+query.getCode()+",不在值域范围参考"+query.getTableCode()+"内");
				}
			}
			if(checkPageIndex.getReceiveUnitNameOfTransferHospital()!= null){
				if(checkPageIndex.getReceiveUnitNameOfTransferHospital().length() > 100){
					addErrorDesc(errorDesc,"转入医院名称长度不应大于100");
				}
			}
			if(checkPageIndex.getReceiveUnitNameOfTransferCommunity()!= null){
				if(checkPageIndex.getReceiveUnitNameOfTransferCommunity().length() > 100){
					addErrorDesc(errorDesc,"转入社区服务机构/乡镇卫生院名称长度不应大于100");
				}
			}
			if(checkPageIndex.getTotalCost()== null){
				addErrorDesc(errorDesc,"住院总费用不能为空");
			}else{
				if(checkPageIndex.getTotalCost().intValue() > 99999999 || checkPageIndex.getTotalCost().intValue() <0){
					addErrorDesc(errorDesc,"住院总费用应为数字(10,2)");
				}
			}
			if(checkPageIndex.getSelfCost()== null){
				addErrorDesc(errorDesc,"自付金额不能为空");
			}else{
				if(checkPageIndex.getSelfCost().intValue() > 99999999 || checkPageIndex.getSelfCost().intValue() <0){
					addErrorDesc(errorDesc,"自付金额应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC01001Cost()!= null){
				if(checkPageIndex.getC01001Cost().intValue() > 99999999 || checkPageIndex.getC01001Cost().intValue() <0){
					addErrorDesc(errorDesc,"一般医疗服务费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC01002Cost()!= null){
				if(checkPageIndex.getC01002Cost().intValue() > 99999999 || checkPageIndex.getC01002Cost().intValue() <0){
					addErrorDesc(errorDesc,"一般治疗操作费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC01003Cost()!= null){
				if(checkPageIndex.getC01003Cost().intValue() > 99999999 || checkPageIndex.getC01003Cost().intValue() <0){
					addErrorDesc(errorDesc,"护理费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC01999Cost()!= null){
				if(checkPageIndex.getC01999Cost().intValue() > 99999999 || checkPageIndex.getC01999Cost().intValue() <0){
					addErrorDesc(errorDesc,"综合医疗服务类其他费用应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC02001Cost()!= null){
				if(checkPageIndex.getC02001Cost().intValue() > 99999999 || checkPageIndex.getC02001Cost().intValue() <0){
					addErrorDesc(errorDesc,"病理诊断费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC02002Cost()!= null){
				if(checkPageIndex.getC02002Cost().intValue() > 99999999 || checkPageIndex.getC02002Cost().intValue() <0){
					addErrorDesc(errorDesc,"实验室诊断费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC02003Cost()!= null){
				if(checkPageIndex.getC02003Cost().intValue() > 99999999 || checkPageIndex.getC02003Cost().intValue() <0){
					addErrorDesc(errorDesc,"影像学诊断费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC02004Cost()!= null){
				if(checkPageIndex.getC02004Cost().intValue() > 99999999 || checkPageIndex.getC02004Cost().intValue() <0){
					addErrorDesc(errorDesc,"临床诊断项目费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC03001Cost()!= null){
				if(checkPageIndex.getC03001Cost().intValue() > 99999999 || checkPageIndex.getC03001Cost().intValue() <0){
					addErrorDesc(errorDesc,"非手术治疗项目费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC03002Cost()!= null){
				if(checkPageIndex.getC03002Cost().intValue() > 99999999 || checkPageIndex.getC03002Cost().intValue() <0){
					addErrorDesc(errorDesc,"临床物理治疗费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC03003Cost()!= null){
				if(checkPageIndex.getC03003Cost().intValue() > 99999999 || checkPageIndex.getC03003Cost().intValue() <0){
					addErrorDesc(errorDesc,"手术治疗费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC03004Cost()!= null){
				if(checkPageIndex.getC03004Cost().intValue() > 99999999 || checkPageIndex.getC03004Cost().intValue() <0){
					addErrorDesc(errorDesc,"麻醉费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC03005Cost()!= null){
				if(checkPageIndex.getC03005Cost().intValue() > 99999999 || checkPageIndex.getC03005Cost().intValue() <0){
					addErrorDesc(errorDesc,"手术费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC04001Cost()!= null){
				if(checkPageIndex.getC04001Cost().intValue() > 99999999 || checkPageIndex.getC04001Cost().intValue() <0){
					addErrorDesc(errorDesc,"康复费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC05001Cost()!= null){
				if(checkPageIndex.getC05001Cost().intValue() > 99999999 || checkPageIndex.getC05001Cost().intValue() <0){
					addErrorDesc(errorDesc,"中医治疗费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC06001Cost()!= null){
				if(checkPageIndex.getC06001Cost().intValue() > 99999999 || checkPageIndex.getC06001Cost().intValue() <0){
					addErrorDesc(errorDesc,"西药费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC06002Cost()!= null){
				if(checkPageIndex.getC06002Cost().intValue() > 99999999 || checkPageIndex.getC06002Cost().intValue() <0){
					addErrorDesc(errorDesc,"抗菌药物费用应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC07001Cost()!= null){
				if(checkPageIndex.getC07001Cost().intValue() > 99999999 || checkPageIndex.getC07001Cost().intValue() <0){
					addErrorDesc(errorDesc,"中成药费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC07002Cost()!= null){
				if(checkPageIndex.getC07002Cost().intValue() > 99999999 || checkPageIndex.getC07002Cost().intValue() <0){
					addErrorDesc(errorDesc,"中草药费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC08001Cost()!= null){
				if(checkPageIndex.getC08001Cost().intValue() > 99999999 || checkPageIndex.getC08001Cost().intValue() <0){
					addErrorDesc(errorDesc,"血费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC08002Cost()!= null){
				if(checkPageIndex.getC08002Cost().intValue() > 99999999 || checkPageIndex.getC08002Cost().intValue() <0){
					addErrorDesc(errorDesc,"白蛋白类制品费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC08003Cost()!= null){
				if(checkPageIndex.getC08003Cost().intValue() > 99999999 || checkPageIndex.getC08003Cost().intValue() <0){
					addErrorDesc(errorDesc,"球蛋白类制品费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC08004Cost()!= null){
				if(checkPageIndex.getC08004Cost().intValue() > 99999999 || checkPageIndex.getC08004Cost().intValue() <0){
					addErrorDesc(errorDesc,"凝血因子类制品费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC08005Cost()!= null){
				if(checkPageIndex.getC08005Cost().intValue() > 99999999 || checkPageIndex.getC08005Cost().intValue() <0){
					addErrorDesc(errorDesc,"细胞因子类制品费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC09001Cost()!= null){
				if(checkPageIndex.getC09001Cost().intValue() > 99999999 || checkPageIndex.getC09001Cost().intValue() <0){
					addErrorDesc(errorDesc,"检查用一次性医用材料费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC09002Cost()!= null){
				if(checkPageIndex.getC09002Cost().intValue() > 99999999 || checkPageIndex.getC09002Cost().intValue() <0){
					addErrorDesc(errorDesc,"治疗用一次性医用材料费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC09003Cost()!= null){
				if(checkPageIndex.getC09003Cost().intValue() > 99999999 || checkPageIndex.getC09003Cost().intValue() <0){
					addErrorDesc(errorDesc,"手术用一次性医用材料费应为数字(10,2)");
				}
			}
			if(checkPageIndex.getC99999Cost()!= null){
				if(checkPageIndex.getC99999Cost().intValue() > 99999999 || checkPageIndex.getC99999Cost().intValue() <0){
					addErrorDesc(errorDesc,"其他费应为数字(10,2)");
				}
			}

			if(checkPageIndex.getYearOfAge()== null && checkPageIndex.getMonthOfAge() == null){
				addErrorDesc(errorDesc,"年龄、（年龄不足1周岁的）年龄二者至少填一个");
			}
			if(checkPageIndex.getPermanentAddress() == null && checkPageIndex.getWorkUnitNameAndAddress() == null
					&& checkPageIndex.getRegisteredAddress() == null){
				addErrorDesc(errorDesc,"现住址、工作单位及地址 、户口地址三者至少填一个");
			}

			if(checkPageIndex.getPermanentAddressPhone() == null && checkPageIndex.getWorkUnitPhone() == null){
				addErrorDesc(errorDesc,"住宅电话、电话 二者至少填一个");
			}

			if(checkPageIndex.getInDeptCode() != null && checkPageIndex.getOutDeptCode() != null){
				if(!checkPageIndex.getInDeptCode().equalsIgnoreCase(checkPageIndex.getOutDeptCode())){
					if(checkPageIndex.getChangeDeptCodes() == null){
						addErrorDesc(errorDesc,"入院科别与出院科别不一致时转科科别必填");
					}
				}
			}

			if(checkPageIndex.getOtherDiag1Code()!= null || checkPageIndex.getOtherDiag1Name() != null
					|| checkPageIndex.getOtherDiag1AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag1Code()== null || checkPageIndex.getOtherDiag1Name() == null
						|| checkPageIndex.getOtherDiag1AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断1信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag2Code()!= null || checkPageIndex.getOtherDiag2Name() != null
					|| checkPageIndex.getOtherDiag2AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag2Code()== null || checkPageIndex.getOtherDiag2Name() == null
						|| checkPageIndex.getOtherDiag2AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断2信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag3Code()!= null || checkPageIndex.getOtherDiag3Name() != null
					|| checkPageIndex.getOtherDiag3AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag3Code()== null || checkPageIndex.getOtherDiag3Name() == null
						|| checkPageIndex.getOtherDiag3AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断3信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag4Code()!= null || checkPageIndex.getOtherDiag4Name() != null
					|| checkPageIndex.getOtherDiag4AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag4Code()== null || checkPageIndex.getOtherDiag4Name() == null
						|| checkPageIndex.getOtherDiag4AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断4信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag5Code()!= null || checkPageIndex.getOtherDiag5Name() != null
					|| checkPageIndex.getOtherDiag5AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag5Code()== null || checkPageIndex.getOtherDiag5Name() == null
						|| checkPageIndex.getOtherDiag5AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断5信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag6Code()!= null || checkPageIndex.getOtherDiag6Name() != null
					|| checkPageIndex.getOtherDiag6AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag6Code()== null || checkPageIndex.getOtherDiag6Name() == null
						|| checkPageIndex.getOtherDiag6AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断6信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag7Code()!= null || checkPageIndex.getOtherDiag7Name() != null
					|| checkPageIndex.getOtherDiag7AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag7Code()== null || checkPageIndex.getOtherDiag7Name() == null
						|| checkPageIndex.getOtherDiag7AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断7信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag8Code()!= null || checkPageIndex.getOtherDiag8Name() != null
					|| checkPageIndex.getOtherDiag8AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag8Code()== null || checkPageIndex.getOtherDiag8Name() == null
						|| checkPageIndex.getOtherDiag8AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断8信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag9Code()!= null || checkPageIndex.getOtherDiag9Name() != null
					|| checkPageIndex.getOtherDiag9AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag9Code()== null || checkPageIndex.getOtherDiag9Name() == null
						|| checkPageIndex.getOtherDiag9AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断9信息不完整");
				}
			}

			if(checkPageIndex.getOtherDiag10Code()!= null || checkPageIndex.getOtherDiag10Name() != null
					|| checkPageIndex.getOtherDiag10AdmissionConditionCode()!= null){
				if(checkPageIndex.getOtherDiag10Code()== null || checkPageIndex.getOtherDiag10Name() == null
						|| checkPageIndex.getOtherDiag10AdmissionConditionCode()== null){
					addErrorDesc(errorDesc,"其他诊断10信息不完整");
				}
			}

			if(checkPageIndex.getPathologyDiag1Code() != null
					||checkPageIndex.getPathologyDiag1Name() != null){
				if(checkPageIndex.getPathologyDiag1Code() == null
						||checkPageIndex.getPathologyDiag1Name() == null){
					addErrorDesc(errorDesc,"病理学诊断1信息不完整");
				}

			}

			if(checkPageIndex.getPathologyDiag2Code() != null
					||checkPageIndex.getPathologyDiag2Name() != null){
				if(checkPageIndex.getPathologyDiag2Code() == null
						||checkPageIndex.getPathologyDiag2Name() == null){
					addErrorDesc(errorDesc,"病理学诊断2信息不完整");
				}
			}

			if(checkPageIndex.getPathologyDiag3Code() != null
					||checkPageIndex.getPathologyDiag3Name() != null){
				if(checkPageIndex.getPathologyDiag3Code() == null
						||checkPageIndex.getPathologyDiag3Name() == null){
					addErrorDesc(errorDesc,"病理学诊断3信息不完整");
				}
			}

			List<String> needPathologyDiagPrefixList = new ArrayList<String>();
			needPathologyDiagPrefixList.add("C");
			for(int i= 0;i<=48;i++){
				needPathologyDiagPrefixList.add("D"+StringUtil.getFormatNumber(i, 2));
			}
			if(checkPageIndex.getMainDiagCode()!= null){
				for (String needPathologyDiagPrefix : needPathologyDiagPrefixList) {
					if(checkPageIndex.getMainDiagCode().toUpperCase().startsWith(needPathologyDiagPrefix)){
						if(checkPageIndex.getPathologyDiag1Code() == null &&checkPageIndex.getPathologyDiag2Code() == null
								&& checkPageIndex.getPathologyDiag3Code() == null){
							addErrorDesc(errorDesc,"主要诊断编码首字母为C或D00-D48时必填,病理诊断必填");
							break;
						}

					}
				}
			}

			if(checkPageIndex.getMalignantTumorHighestDiagBasisCode()!= null){
				if(checkPageIndex.getMalignantTumorHighestDiagBasisCode().equalsIgnoreCase("1")){
					if(checkPageIndex.getPathologyNumber1()==null && checkPageIndex.getPathologyNumber2()==null
							&&checkPageIndex.getPathologyNumber3() == null){
						addErrorDesc(errorDesc,"最高诊断依据为病理，则至少填写一个病理号（三者至少填一个）");
					}
				}
			}
			for (String otherDiagCode : otherDiagRepeatCodes.keySet()) {
				Integer otherDiagCodeCount = otherDiagRepeatCodes.get(otherDiagCode);
				if(otherDiagCodeCount!= null && otherDiagCodeCount>1){
					addErrorDesc(errorDesc,"主要或其他诊断:"+otherDiagCode+"重复");
				}
			}
			//List<Character> newDamageDiagPrefixList = StringUtil.getEnglishLetters('V', 'Y');
			List<String> needDamageDiagPrefixList = new ArrayList<String>();
			for(int i= 0;i<=99;i++){
				needDamageDiagPrefixList.add("S"+StringUtil.getFormatNumber(i, 2));
			}
			for(int i= 0;i<=98;i++){
				needDamageDiagPrefixList.add("T"+StringUtil.getFormatNumber(i, 2));
			}
			for (String diagCode : allDiagCodes) {
				for (String needDamageDiagPrefix : needDamageDiagPrefixList) {
					if(diagCode.startsWith(needDamageDiagPrefix)){
						if(checkPageIndex.getDamageAndVenenationDiag1Name() ==null){
							addErrorDesc(errorDesc,"主要诊断或其他诊断编码含“S00-T98”开头编码时，损伤、中毒的外部因素名称1不能为空");
							break;
						}

					}
				}


			}
			if(checkPageIndex.getDamageAndVenenationDiag1Name()!=null){
				if(checkPageIndex.getDamageAndVenenationDiag1Code() ==null){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素名称1有值时，损伤、中毒的外部因素编码1不能为空");
				}
			}else if(checkPageIndex.getDamageAndVenenationDiag1Code()!=null){
				if(checkPageIndex.getDamageAndVenenationDiag1Name() ==null){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素编码1有值时，损伤、中毒的外部因素名称1不能为空");
				}
			}
			if(checkPageIndex.getDamageAndVenenationDiag2Name()!=null){
				if(checkPageIndex.getDamageAndVenenationDiag2Code() ==null){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素名称2有值时，损伤、中毒的外部因素编码2不能为空");
				}
			}else if(checkPageIndex.getDamageAndVenenationDiag2Code()!=null){
				if(checkPageIndex.getDamageAndVenenationDiag2Name() ==null){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素编码2有值时，损伤、中毒的外部因素名称2不能为空");
				}
			}
			if(checkPageIndex.getDamageAndVenenationDiag3Name()!=null){
				if(checkPageIndex.getDamageAndVenenationDiag3Code() ==null){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素名称3有值时，损伤、中毒的外部因素编码3不能为空");
				}
			}else if(checkPageIndex.getDamageAndVenenationDiag3Code()!=null){
				if(checkPageIndex.getDamageAndVenenationDiag3Name() ==null){
					addErrorDesc(errorDesc,"损伤、中毒的外部因素编码3有值时，损伤、中毒的外部因素名称3不能为空");
				}
			}

			if(checkPageIndex.getSurgery1Name()!=null){
				if(checkPageIndex.getSurgery1Code()== null || checkPageIndex.getSurgery1DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称1不为空，则必须填写手术操作编码1和手术操作日期1");
				}
			}

			if(checkPageIndex.getSurgeryPatientTypeCodes() != null){
				if(checkPageIndex.getSurgeryPatientTypeCodes().contains("1")
						|| checkPageIndex.getSurgeryPatientTypeCodes().contains("2")){
					if(checkPageIndex.getSurgery1Name() == null){
						addErrorDesc(errorDesc,"手术患者类型为急诊手术或择期手术时手术操作名称1不能为空");
					}
				}
			}
			if(checkPageIndex.getSurgery2Name()!=null){
				if(checkPageIndex.getSurgery2Code()== null || checkPageIndex.getSurgery2DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称2不为空，则必须填写手术操作编码2和手术操作日期2");
				}
			}
			if(checkPageIndex.getSurgery3Name()!=null){
				if(checkPageIndex.getSurgery3Code()== null || checkPageIndex.getSurgery3DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称3不为空，则必须填写手术操作编码3和手术操作日期3");
				}
			}
			if(checkPageIndex.getSurgery4Name()!=null){
				if(checkPageIndex.getSurgery4Code()== null || checkPageIndex.getSurgery4DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称4不为空，则必须填写手术操作编码4和手术操作日期4");
				}
			}
			if(checkPageIndex.getSurgery5Name()!=null){
				if(checkPageIndex.getSurgery5Code()== null || checkPageIndex.getSurgery5DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称5不为空，则必须填写手术操作编码5和手术操作日期5");
				}
			}
			if(checkPageIndex.getSurgery6Name()!=null){
				if(checkPageIndex.getSurgery6Code()== null || checkPageIndex.getSurgery6DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称6不为空，则必须填写手术操作编码6和手术操作日期6");
				}
			}
			if(checkPageIndex.getSurgery7Name()!=null){
				if(checkPageIndex.getSurgery7Code()== null || checkPageIndex.getSurgery7DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称7不为空，则必须填写手术操作编码7和手术操作日期7");
				}
			}
			if(checkPageIndex.getSurgery8Name()!=null){
				if(checkPageIndex.getSurgery8Code()== null || checkPageIndex.getSurgery8DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称8不为空，则必须填写手术操作编码8和手术操作日期8");
				}
			}
			if(checkPageIndex.getSurgery9Name()!=null){
				if(checkPageIndex.getSurgery9Code()== null || checkPageIndex.getSurgery9DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称9不为空，则必须填写手术操作编码9和手术操作日期9");
				}
			}
			if(checkPageIndex.getSurgery10Name()!=null){
				if(checkPageIndex.getSurgery10Code()== null || checkPageIndex.getSurgery10DateTime() == null){
					addErrorDesc(errorDesc,"手术操作名称10不为空，则必须填写手术操作编码10和手术操作日期10");
				}
			}
			if(allDiagCodePrefixs.contains("Z37")){
				if(checkPageIndex.getBabyBirthWeight() == null){
					addErrorDesc(errorDesc,"当其它诊断编码为Z37，新生儿出生体重不能为空");
				}
			}

			if(checkPageIndex.getIsRehospitalAfter31DayPlanCode()!= null){
				if(checkPageIndex.getIsRehospitalAfter31DayPlanCode().equalsIgnoreCase("2")){
					if(checkPageIndex.getRehospitalAfter31DayAimName()== null){
						addErrorDesc(errorDesc,"有出院31天内再住院计划时出院31天再住院计划目的不能为空");
					}
				}
			}

			if(checkPageIndex.getOutHospitalTypeCode() != null){
				if(checkPageIndex.getOutHospitalTypeCode().equalsIgnoreCase("2")){
					if(checkPageIndex.getReceiveUnitNameOfTransferHospital() == null){
						addErrorDesc(errorDesc,"离院方式为“医嘱转院”时转入医院名称不能为空");
					}
				}else if(checkPageIndex.getOutHospitalTypeCode().equalsIgnoreCase("3")){
					if(checkPageIndex.getReceiveUnitNameOfTransferCommunity() == null){
						addErrorDesc(errorDesc,"离院方式为“医嘱转社区卫生服务机构/乡镇卫生院”时转入社区服务机构/乡镇卫生院名称");
					}
				}
			}

			if(checkPageIndex.getSexCode()!= null &&checkPageIndex.getSexCode().equalsIgnoreCase("1")){
				List<String> manNotFitdiagCodes = new ArrayList<String>();
				manNotFitdiagCodes.add("A34");
				manNotFitdiagCodes.add("B37.3");
				for(int i= 51;i<=58;i++){
					manNotFitdiagCodes.add("C"+i);
				}
				manNotFitdiagCodes.add("C79.6");
				manNotFitdiagCodes.add("D06");
				for(int i= 0;i<=3;i++){
					manNotFitdiagCodes.add("D07."+i);
				}
				for(int i= 25;i<=28;i++){
					manNotFitdiagCodes.add("D"+i);
				}
				manNotFitdiagCodes.add("D39");
				manNotFitdiagCodes.add("E28");
				manNotFitdiagCodes.add("E89.4");
				manNotFitdiagCodes.add("F52.5");
				manNotFitdiagCodes.add("F53");
				manNotFitdiagCodes.add("I86.3");
				manNotFitdiagCodes.add("L29.2");
				//manNotFitdiagCodes.add("L70.5");
				manNotFitdiagCodes.add("M80.0");
				manNotFitdiagCodes.add("M80.1");
				manNotFitdiagCodes.add("M81.0");
				manNotFitdiagCodes.add("M81.1");
				manNotFitdiagCodes.add("M83.0");
				for(int i= 70;i<=98;i++){
					manNotFitdiagCodes.add("N"+i);
				}
				for(int i= 2;i<=3;i++){
					manNotFitdiagCodes.add("N99."+i);
				}
				for(int i= 0;i<=99;i++){
					manNotFitdiagCodes.add("O"+StringUtil.getFormatNumber(i, 2));
				}
				manNotFitdiagCodes.add("P54.6");
				manNotFitdiagCodes.add("Q50");
				manNotFitdiagCodes.add("Q51");
				manNotFitdiagCodes.add("Q52");
				manNotFitdiagCodes.add("R87");
				manNotFitdiagCodes.add("S31.4");
				for(int i= 4;i<=6;i++){
					manNotFitdiagCodes.add("S37."+i);
				}
				for(int i= 2;i<=3;i++){
					manNotFitdiagCodes.add("T19."+i);
				}
				manNotFitdiagCodes.add("T83.3");
				manNotFitdiagCodes.add("Z01.4");
				manNotFitdiagCodes.add("Z12.4");
				manNotFitdiagCodes.add("Z30.1");
				manNotFitdiagCodes.add("Z30.3");
				manNotFitdiagCodes.add("Z30.5");
				manNotFitdiagCodes.add("Z31.1");
				manNotFitdiagCodes.add("Z31.2");
				for(int i= 32;i<=37;i++){
					manNotFitdiagCodes.add("Z"+i);
				}
				manNotFitdiagCodes.add("Z39");
				//manNotFitdiagCodes.add("Z43.7");
				manNotFitdiagCodes.add("Z87.5");
				manNotFitdiagCodes.add("Z97.5");
				boolean result = false;
				for (String manNotFitdiagCode : manNotFitdiagCodes) {
					for (String diagCode : allDiagCodes) {
						if(diagCode.toUpperCase().startsWith(manNotFitdiagCode)){
							addErrorDesc(errorDesc,"当性别为男性时，诊断编码不能使用以下编码:A34 ； B37.3 ； C51-C58 ；C79.6；D06；D07.0-D07.3；"
									+ "D25-D28；D39；E28；E89.4；F52.5；F53；I86.3；L29.2；M80.0-M80.1 ；M81.0-M81.1 ； M83.0 ；"
									+ "N70-N98 ； N99.2-N99.3 ；O00-O99；P54.6；Q50-Q52；R87；S31.4；S37.4-S37.6；T19.2-T19.3；T83.3；Z01.4；"
									+ "Z12.4；Z30.1；Z30.3；Z30.5；Z31.1-Z31.2；Z32- Z37 ；Z39；Z87.5；Z97.5");
							result = true;
							break;
						}
					}
					if(result){
						break;
					}
				}
			}
			if(checkPageIndex.getSexCode()!= null &&checkPageIndex.getSexCode().equalsIgnoreCase("2")){
				List<String> womanNotFitDiagCodes = new ArrayList<String>();
				womanNotFitDiagCodes.add("B26.0");
				womanNotFitDiagCodes.add("C60");
				womanNotFitDiagCodes.add("C61");
				womanNotFitDiagCodes.add("C62");
				womanNotFitDiagCodes.add("C63");
				womanNotFitDiagCodes.add("D07.4");
				womanNotFitDiagCodes.add("D07.5");
				womanNotFitDiagCodes.add("D07.6");
				womanNotFitDiagCodes.add("D17.6");
				womanNotFitDiagCodes.add("D29");
				womanNotFitDiagCodes.add("D40");
				womanNotFitDiagCodes.add("E29");
				womanNotFitDiagCodes.add("E89.5");
				womanNotFitDiagCodes.add("F52.4");
				womanNotFitDiagCodes.add("I86.1");
				womanNotFitDiagCodes.add("L29.1");
				for(int i= 40;i<=51;i++){
					womanNotFitDiagCodes.add("N"+i);
				}
				womanNotFitDiagCodes.add("Q53");
				womanNotFitDiagCodes.add("Q54");
				womanNotFitDiagCodes.add("Q55");
				womanNotFitDiagCodes.add("R86");
				womanNotFitDiagCodes.add("S31.2");
				womanNotFitDiagCodes.add("S31.3");
				womanNotFitDiagCodes.add("Z12.5");
				boolean result = false;
				for (String womanNotFitDiagCode : womanNotFitDiagCodes) {
					for (String diagCode : allDiagCodes) {
						if(diagCode.toUpperCase().startsWith(womanNotFitDiagCode)){
							addErrorDesc(errorDesc,"当性别为女性时，诊断编码不能使用以下编码:B26.0；C60-C63；D07.4-D07.6；"
									+ "D17.6；D29；D40；E29；E89.5；F52.4；I86.1；L29.1；"
									+ "N40-N51；Q53-Q55；R86；S31.2-S31.3；Z12.5");
							result = true;
							break;
						}
					}
					if(result){
						break;
					}
				}
			}

			if(checkPageIndex.getBirthday()!= null
					&& checkPageIndex.getInHospitalDateTime() != null
					&& checkPageIndex.getYearOfAge() != null){
					Map<String, Integer> dateDiff = DateUtil.getYearMonthDay(checkPageIndex.getBirthday(),checkPageIndex.getInHospitalDateTime());

					if(dateDiff.get("year") != null){
						int year = dateDiff.get("year");
						if(year > checkPageIndex.getYearOfAge()+1 || checkPageIndex.getYearOfAge()-1 >year){
							addErrorDesc(errorDesc,"年龄应等于入院日期减出生日期（误差范围1岁）");
						}
					}else{
						int year = 0;
						if(year > checkPageIndex.getYearOfAge()+1 || checkPageIndex.getYearOfAge()-1 >year){
							addErrorDesc(errorDesc,"年龄应等于入院日期减出生日期（误差范围1岁）");
						}

					}
			}
			if(checkPageIndex.getInHospitalDateTime() != null && checkPageIndex.getOutHospitalDateTime()!= null){
				if(checkPageIndex.getInHospitalDateTime().after(checkPageIndex.getOutHospitalDateTime())){
					addErrorDesc(errorDesc,"入院日期应≤出院日期");
				}
				if(checkPageIndex.getInHospitaledDiagConfirmedDateTime() != null){
					if(checkPageIndex.getInHospitalDateTime().after(checkPageIndex.getInHospitaledDiagConfirmedDateTime())
							|| checkPageIndex.getInHospitaledDiagConfirmedDateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"入院日期应≤入院后确诊日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery1DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery1DateTime())
							|| checkPageIndex.getSurgery1DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期1应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery2DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery2DateTime())
							|| checkPageIndex.getSurgery2DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期2应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery3DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery3DateTime())
							|| checkPageIndex.getSurgery3DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期3应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery4DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery4DateTime())
							|| checkPageIndex.getSurgery4DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期4应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery5DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery5DateTime())
							|| checkPageIndex.getSurgery5DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期5应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery6DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery6DateTime())
							|| checkPageIndex.getSurgery6DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期6应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery7DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery7DateTime())
							|| checkPageIndex.getSurgery7DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期7应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery8DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery8DateTime())
							|| checkPageIndex.getSurgery8DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期8应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery9DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery9DateTime())
							|| checkPageIndex.getSurgery9DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期9应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
				if(checkPageIndex.getSurgery10DateTime() != null){
					if(DateUtil.getLastDay(checkPageIndex.getInHospitalDateTime()).after(checkPageIndex.getSurgery10DateTime())
							|| checkPageIndex.getSurgery10DateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"手术操作日期10应≥入院日期-1天、手术操作日期应≤出院日期");
					}
				}
			}
			List<Character> damageAndVenenationDiagPrefixList = StringUtil.getEnglishLetters('V', 'Y');
			//damageAndVenenationDiagPrefixList.add('M');
			String damageAndVenenationDiagPrefixListStr = StringUtil.join(damageAndVenenationDiagPrefixList, ',');
			for (String diagCode : allDiagCodes) {
				String firstChar = diagCode.substring(0,1).toUpperCase();
				if(damageAndVenenationDiagPrefixListStr.contains(firstChar)){
					addErrorDesc(errorDesc,"门（急）诊诊断编码、入院诊断编码、"
							+ "主要诊断编码、其它诊断编码各项编码范围应为："
							+ "A～U开头和Z开头的编码；不包括字母V、W、X、Y开头的编码");
					break;
				}
			}
			String childbirthDiagPrefix="O80,O81,O82,O83,O84";
			String noCurrentProductionTerminalPrefix ="O00,O01,O02,O03,O04,O05,O06,O07,O08";
			String childbirthResultDiagPrefix="Z37";
			boolean isChildbirth = false;
			boolean isNoCurrentProductionTerminal= false;
			boolean isChildbirthResult = false;
			for (String diagCode : allDiagCodes) {
				String thirdChar = diagCode.substring(0,3).toUpperCase();
				if(childbirthDiagPrefix.contains(thirdChar)){
					isChildbirth = true;
				}
				if(noCurrentProductionTerminalPrefix.contains(thirdChar)){
					isNoCurrentProductionTerminal = true;
				}
				if(childbirthResultDiagPrefix.contains(thirdChar)){
					isChildbirthResult = true;
				}
			}
			if(isChildbirth && isNoCurrentProductionTerminal){
				if(!isChildbirthResult){
					addErrorDesc(errorDesc,"当主要诊断或者其它诊断编码出现O80-O84编码，"
							+ "且无 流 产 结 局 编 码 出 现O00-O08编码时，"
							+ "其它诊断编码必须有分娩结局编码Z37");
				}
			}
			if(checkPageIndex.getDamageAndVenenationDiag1Code()!=null){
				String firstChar = checkPageIndex.getDamageAndVenenationDiag1Code().substring(0,1).toUpperCase();
				if(!damageAndVenenationDiagPrefixListStr.contains(firstChar)){
					addErrorDesc(errorDesc,"损 伤 和中 毒 外部 原 因1编 码应未V、W、X、Y开头的");
				}
			}
			if(checkPageIndex.getDamageAndVenenationDiag2Code()!=null){
				String firstChar = checkPageIndex.getDamageAndVenenationDiag2Code().substring(0,1).toUpperCase();
				if(!damageAndVenenationDiagPrefixListStr.contains(firstChar)){
					addErrorDesc(errorDesc,"损 伤 和中 毒 外部 原 因2编 码应未V、W、X、Y开头的");
				}
			}
			if(checkPageIndex.getDamageAndVenenationDiag3Code()!=null){
				String firstChar = checkPageIndex.getDamageAndVenenationDiag3Code().substring(0,1).toUpperCase();
				if(!damageAndVenenationDiagPrefixListStr.contains(firstChar)){
					addErrorDesc(errorDesc,"损 伤 和中 毒 外部 原 因3编 码应未V、W、X、Y开头的");
				}
			}
			boolean isDiagNeedRescue = false;
			for (String diagTreatResultCode : diagTreatResultCodes) {
				if(diagTreatResultCode.equalsIgnoreCase("3")
						||diagTreatResultCode.equalsIgnoreCase("4")
						||diagTreatResultCode.equalsIgnoreCase("9")){
					isDiagNeedRescue = true;
					break;
				}
			}
			boolean isOutHospitalResultNeedRescue = false;
			if(checkPageIndex.getOutHospitalTypeCode()!= null
					&&(checkPageIndex.getOutHospitalTypeCode().equalsIgnoreCase("4")
							||checkPageIndex.getOutHospitalTypeCode().equalsIgnoreCase("5")
							||checkPageIndex.getOutHospitalTypeCode().equalsIgnoreCase("9"))){

				isOutHospitalResultNeedRescue = true;
			}
			if(checkPageIndex.getRescueTimes() != null && checkPageIndex.getRescueTimes() !=null){
				if(checkPageIndex.getRescueTimes()!= checkPageIndex.getRescueTimes()){
					if(!(isOutHospitalResultNeedRescue || isDiagNeedRescue)){
						addErrorDesc(errorDesc,"主要诊断出院情况、其他诊断出院情况出现“3 未愈、4死亡、9其他”、"
								+ "离院方式出现“4非医嘱离院、5死亡、9其他”，"
								+ "抢救次数可以等于抢救成功次数加1，表示最后一次抢救未成功");
					}
				}
			}else if(checkPageIndex.getRescueTimes() != null || checkPageIndex.getRescueTimes() !=null){
				addErrorDesc(errorDesc,"抢救次数应等于抢救成功数");
			}
			if(isChildbirthResult){
				if(checkPageIndex.getBabyBirthWeight() == null
						&&checkPageIndex.getBaby2BirthWeight() == null
						&&checkPageIndex.getBaby3BirthWeight() == null
						&&checkPageIndex.getBaby4BirthWeight() == null
						&&checkPageIndex.getBaby5BirthWeight() == null){
					addErrorDesc(errorDesc,"当其它诊断编码为Z37，新生儿出生体重不能为空");
				}
			}
			if(checkPageIndex.getMonthOfAge()!= null){
				if(checkPageIndex.getMonthOfAge().compareTo(new BigDecimal("1")) <= 0
						&&checkPageIndex.getBabyInHospitalWeight() == null){
					addErrorDesc(errorDesc,"（年龄不足1周岁的）年龄≤28天,新生儿入院体重不能为空");
				}
			}else{
				if(checkPageIndex.getBirthday()!= null
						&& checkPageIndex.getInHospitalDateTime() != null){
						int dayDiff = DateUtil.getDaysBetweenOfUpward(checkPageIndex.getBirthday(), checkPageIndex.getInHospitalDateTime());
						if(dayDiff<=28&&checkPageIndex.getBabyInHospitalWeight() == null){
							addErrorDesc(errorDesc,"（年龄不足1周岁的）年龄≤28天,新生儿入院体重不能为空");
						}
				}
			}
			if(checkPageIndex.getYearOfAge() != null && checkPageIndex.getYearOfAge() == 0){
				if(checkPageIndex.getMonthOfAge()== null){
					addErrorDesc(errorDesc,"年龄小于1周岁即年龄为0时，（年龄不足1周岁的）年龄不能为空");
				}
			}
			if(checkPageIndex.getIntensiveCare1TypeCode()!= null || checkPageIndex.getIntensiveCare1EnterDateTime()!= null
					|| checkPageIndex.getIntensiveCare1ExitDateTime() !=null){
				if(!(checkPageIndex.getIntensiveCare1TypeCode()!= null && checkPageIndex.getIntensiveCare1EnterDateTime()!= null
					&& checkPageIndex.getIntensiveCare1ExitDateTime() !=null)){
					addErrorDesc(errorDesc,"监护室进入1数据不完整");
				}
			}
			if(checkPageIndex.getIntensiveCare2TypeCode()!= null || checkPageIndex.getIntensiveCare2EnterDateTime()!= null
					|| checkPageIndex.getIntensiveCare2ExitDateTime() !=null){
				if(!(checkPageIndex.getIntensiveCare2TypeCode()!= null && checkPageIndex.getIntensiveCare2EnterDateTime()!= null
					&& checkPageIndex.getIntensiveCare2ExitDateTime() !=null)){
					addErrorDesc(errorDesc,"监护室进入2数据不完整");
				}
			}
			if(checkPageIndex.getIntensiveCare3TypeCode()!= null || checkPageIndex.getIntensiveCare3EnterDateTime()!= null
					|| checkPageIndex.getIntensiveCare3ExitDateTime() !=null){
				if(!(checkPageIndex.getIntensiveCare3TypeCode()!= null && checkPageIndex.getIntensiveCare3EnterDateTime()!= null
					&& checkPageIndex.getIntensiveCare3ExitDateTime() !=null)){
					addErrorDesc(errorDesc,"监护室进入3数据不完整");
				}
			}
			if(checkPageIndex.getIntensiveCare4TypeCode()!= null || checkPageIndex.getIntensiveCare4EnterDateTime()!= null
					|| checkPageIndex.getIntensiveCare4ExitDateTime() !=null){
				if(!(checkPageIndex.getIntensiveCare4TypeCode()!= null && checkPageIndex.getIntensiveCare4EnterDateTime()!= null
					&& checkPageIndex.getIntensiveCare4ExitDateTime() !=null)){
					addErrorDesc(errorDesc,"监护室进入4数据不完整");
				}
			}
			if(checkPageIndex.getIntensiveCare5TypeCode()!= null || checkPageIndex.getIntensiveCare5EnterDateTime()!= null
					|| checkPageIndex.getIntensiveCare5ExitDateTime() !=null){
				if(!(checkPageIndex.getIntensiveCare5TypeCode()!= null && checkPageIndex.getIntensiveCare5EnterDateTime()!= null
					&& checkPageIndex.getIntensiveCare5ExitDateTime() !=null)){
					addErrorDesc(errorDesc,"监护室进入5数据不完整");
				}
			}
			if(checkPageIndex.getInHospitalDateTime() != null && checkPageIndex.getOutHospitalDateTime()!= null){
				if(checkPageIndex.getIntensiveCare1EnterDateTime() != null && checkPageIndex.getIntensiveCare1ExitDateTime() !=null){
					if(checkPageIndex.getInHospitalDateTime().after(checkPageIndex.getIntensiveCare1EnterDateTime())
							|| checkPageIndex.getIntensiveCare1EnterDateTime().after(checkPageIndex.getIntensiveCare1ExitDateTime())
							|| checkPageIndex.getIntensiveCare1ExitDateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"入院日期≤监护室进入1时间≤监护室退出1时间≤出院日期");
					}
				}
				if(checkPageIndex.getIntensiveCare2EnterDateTime() != null && checkPageIndex.getIntensiveCare2ExitDateTime() !=null){
					if(checkPageIndex.getInHospitalDateTime().after(checkPageIndex.getIntensiveCare2EnterDateTime())
							|| checkPageIndex.getIntensiveCare2EnterDateTime().after(checkPageIndex.getIntensiveCare2ExitDateTime())
							|| checkPageIndex.getIntensiveCare2ExitDateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"入院日期≤监护室进入2时间≤监护室退出2时间≤出院日期");
					}
				}
				if(checkPageIndex.getIntensiveCare3EnterDateTime() != null && checkPageIndex.getIntensiveCare3ExitDateTime() !=null){
					if(checkPageIndex.getInHospitalDateTime().after(checkPageIndex.getIntensiveCare3EnterDateTime())
							|| checkPageIndex.getIntensiveCare3EnterDateTime().after(checkPageIndex.getIntensiveCare3ExitDateTime())
							|| checkPageIndex.getIntensiveCare3ExitDateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"入院日期≤监护室进入3时间≤监护室退出3时间≤出院日期");
					}
				}
				if(checkPageIndex.getIntensiveCare4EnterDateTime() != null && checkPageIndex.getIntensiveCare4ExitDateTime() !=null){
					if(checkPageIndex.getInHospitalDateTime().after(checkPageIndex.getIntensiveCare4EnterDateTime())
							|| checkPageIndex.getIntensiveCare4EnterDateTime().after(checkPageIndex.getIntensiveCare4ExitDateTime())
							|| checkPageIndex.getIntensiveCare4ExitDateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"入院日期≤监护室进入4时间≤监护室退出4时间≤出院日期");
					}
				}
				if(checkPageIndex.getIntensiveCare5EnterDateTime() != null && checkPageIndex.getIntensiveCare5ExitDateTime() !=null){
					if(checkPageIndex.getInHospitalDateTime().after(checkPageIndex.getIntensiveCare5EnterDateTime())
							|| checkPageIndex.getIntensiveCare5EnterDateTime().after(checkPageIndex.getIntensiveCare5ExitDateTime())
							|| checkPageIndex.getIntensiveCare5ExitDateTime().after(checkPageIndex.getOutHospitalDateTime())){
						addErrorDesc(errorDesc,"入院日期≤监护室进入5时间≤监护室退出5时间≤出院日期");
					}
				}
			}
			BigDecimal totalMoney = BigDecimal.ZERO;
			BigDecimal surgicalTreatmentMoney = BigDecimal.ZERO;
			BigDecimal westernMedicineMoney = BigDecimal.ZERO;
			if(checkPageIndex.getC01001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC01001Cost());
			}
			if(checkPageIndex.getC01002Cost()  != null){
				totalMoney = totalMoney.add(checkPageIndex.getC01002Cost() );
			}
			if(checkPageIndex.getC01003Cost()  != null){
				totalMoney = totalMoney.add(checkPageIndex.getC01003Cost() );
			}
			if(checkPageIndex.getC01999Cost()  != null){
				totalMoney = totalMoney.add(checkPageIndex.getC01999Cost() );
			}
			if(checkPageIndex.getC02001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC02001Cost());
			}
			if(checkPageIndex.getC02002Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC02002Cost());
			}
			if(checkPageIndex.getC02003Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC02003Cost());
			}
			if(checkPageIndex.getC02004Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC02004Cost());
			}
			if(checkPageIndex.getC03001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC03001Cost());
			}
			if(checkPageIndex.getC03003Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC03003Cost());
			}

			if(checkPageIndex.getC03004Cost() != null){
				surgicalTreatmentMoney = surgicalTreatmentMoney.add(checkPageIndex.getC03004Cost());
			}

			if(checkPageIndex.getC03005Cost() != null){
				surgicalTreatmentMoney = surgicalTreatmentMoney.add(checkPageIndex.getC03005Cost());
			}

			if(checkPageIndex.getC04001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC04001Cost());
			}
			if(checkPageIndex.getC05001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC05001Cost());
			}
			if(checkPageIndex.getC06001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC06001Cost());
			}
			if(checkPageIndex.getC06002Cost() != null){
				westernMedicineMoney = westernMedicineMoney.add(checkPageIndex.getC06002Cost());
			}

			if(checkPageIndex.getC07001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC07001Cost());
			}
			if(checkPageIndex.getC07002Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC07002Cost());
			}
			if(checkPageIndex.getC08001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC08001Cost());
			}
			if(checkPageIndex.getC08002Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC08002Cost());
			}
			if(checkPageIndex.getC08003Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC08003Cost());
			}
			if(checkPageIndex.getC08004Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC08004Cost());
			}
			if(checkPageIndex.getC08005Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC08005Cost());
			}
			if(checkPageIndex.getC09001Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC09001Cost());
			}
			if(checkPageIndex.getC09002Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC09002Cost());
			}
			if(checkPageIndex.getC09003Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC09003Cost());
			}
			if(checkPageIndex.getC99999Cost() != null){
				totalMoney = totalMoney.add(checkPageIndex.getC99999Cost());
			}

			if(checkPageIndex.getTotalCost()!= null){
				BigDecimal diffCost = checkPageIndex.getTotalCost().subtract(totalMoney);
				if(diffCost.compareTo(new BigDecimal("-1.2"))<0 || diffCost.compareTo(new BigDecimal("1.2")) >0){
					addErrorDesc(errorDesc,"住院总费用("+checkPageIndex.getTotalCost()+")应等于各分项费用("+totalMoney+")"
							+ "（除自付金额,临床物理治疗费,麻醉费,手术费,抗菌药物费用外）之和。"
							+ "允许误差1.2");
				}

				if(checkPageIndex.getSelfCost()!= null){
					diffCost = checkPageIndex.getTotalCost().subtract(checkPageIndex.getSelfCost());
					if(diffCost.compareTo(new BigDecimal("-1.2"))<0){
						addErrorDesc(errorDesc,"住院总费用("+checkPageIndex.getTotalCost()+")必须大于等于住院总费用其中自付金额("+checkPageIndex.getSelfCost()+")"
								+ "（允许误差1.2）");
					}
				}
			}

			if(checkPageIndex.getC03001Cost() != null && checkPageIndex.getC03002Cost() != null){
				BigDecimal diffCost = checkPageIndex.getC03001Cost().subtract(checkPageIndex.getC03002Cost());
				if(diffCost.compareTo(new BigDecimal("-1.2"))<0){
					addErrorDesc(errorDesc,"非手术治疗项目费("+checkPageIndex.getC03001Cost()+")必须大于等于临床物理治疗费("+checkPageIndex.getC03002Cost()+")"
							+ "（允许误差1.2）");
				}
			}
			if(checkPageIndex.getC03003Cost() != null){
				BigDecimal diffCost = checkPageIndex.getC03003Cost().subtract(surgicalTreatmentMoney);
				if(diffCost.compareTo(new BigDecimal("-1.2"))<0){
					addErrorDesc(errorDesc,"手术治疗费("+checkPageIndex.getC03003Cost()+")必须大于等于麻醉费与手术费之和("+surgicalTreatmentMoney+")"
							+ "（允许误差1.2）");
				}
			}
			if(checkPageIndex.getC06001Cost() != null){
				BigDecimal diffCost = checkPageIndex.getC06001Cost().subtract(westernMedicineMoney);
				if(diffCost.compareTo(new BigDecimal("-1.2"))<0){
					addErrorDesc(errorDesc,"西药费("+checkPageIndex.getC06001Cost()+")必须大于等于抗菌药物费用("+westernMedicineMoney+")"
							+ "（允许误差1.2）");
				}
			}
			if(checkPageIndex.getQualityControlDateTime() != null && checkPageIndex.getInHospitalDateTime()!= null){
				if(!checkPageIndex.getQualityControlDateTime().after(checkPageIndex.getInHospitalDateTime())){
					addErrorDesc(errorDesc,"质控日期不能早于入院日期");
				}
			}
			boolean isDeath = false;
			for (String diagTreatResultCode : diagTreatResultCodes) {
				if(diagTreatResultCode.equalsIgnoreCase("4")){
					isDeath = true;
					break;
				}
			}
			if(isDeath){
				if(checkPageIndex.getOutHospitalTypeCode() != null && !checkPageIndex.getOutHospitalTypeCode().equalsIgnoreCase("5")){
					addErrorDesc(errorDesc,"当主要诊断或其他诊断出院情况为死亡时则离院方式应为5死亡");
				}
			}
			if(checkPageIndex.getIsAutopsyCode() != null
					/*&& checkPageIndex.getIsAutopsyCode().equalsIgnoreCase("1")*/){

				if(checkPageIndex.getOutHospitalTypeCode() != null && !checkPageIndex.getOutHospitalTypeCode().equalsIgnoreCase("5")){
					addErrorDesc(errorDesc,"死亡患者尸检为是或否则离院方式应为5死亡");
				}
			}

			if(checkPageIndex.getMalignantTumorHighestDiagBasisCode()!= null
					&& checkPageIndex.getMalignantTumorHighestDiagBasisCode().equalsIgnoreCase("8")){
				if(checkPageIndex.getOutHospitalTypeCode() != null && !checkPageIndex.getOutHospitalTypeCode().equalsIgnoreCase("5")){
					addErrorDesc(errorDesc,"最高诊断依据为尸检时则离院方式应为5死亡");
				}
			}
			if(errorDesc.length()> 0){
				Map<String, Object> errorMedicalRecord = new HashMap<String, Object>();
				errorMedicalRecord.put("visit_guid", checkPageIndex.getVisitGuid());
				errorMedicalRecord.put("patient_name", checkPageIndex.getPatientName());
				errorMedicalRecord.put("only_id", checkPageIndex.getOnlyId());
				errorMedicalRecord.put("mr_id", checkPageIndex.getMrId());
				errorMedicalRecord.put("visit_number", checkPageIndex.getVisitNumber());
				if(checkPageIndex.getOutHospitalDateTime() != null){
					errorMedicalRecord.put("out_hospital_date_format", DateUtil.dateFormat(checkPageIndex.getOutHospitalDateTime()));
				}
				errorMedicalRecord.put("out_dept_code", checkPageIndex.getOutDeptCode());
				errorMedicalRecord.put("out_dept_name", checkPageIndex.getOutDeptCode());
				errorMedicalRecord.put("out_hospital_type_code", checkPageIndex.getOutHospitalTypeCode());

				errorMedicalRecord.put("out_hospital_type_name", checkPageIndex.getOutHospitalTypeCode());

				errorMedicalRecord.put("error_desc", errorDesc.toString());
				errorMedicalRecords.add(errorMedicalRecord);
			}
		}
		return errorMedicalRecords;

	}

	private void addErrorDesc(StringBuilder errorDesc,String error){
		if(errorDesc.length()> 0){
			errorDesc.append(System.getProperty("line.separator"));
		}
		errorDesc.append(error);
	}

	private boolean checkPageIndexDectStrictRef(Map<String, Map<String, String>> pageIndexDectRefs, PageIndexRefQuery query) {
		// TODO Auto-generated method stub
		Map<String,String> pageIndexDectRef = (Map<String,String>)pageIndexDectRefs.get(query.getTableCode());
		if(pageIndexDectRef == null){
			return false;
		}
		if(query.getName()!= null){
			if(pageIndexDectRef.containsValue(query.getName())){
				return true;
			}
		}else if(query.getCode()!= null){
			if(pageIndexDectRef.get(query.getCode()) !=null){
				return true;
			}
		}
		return false;
	}

	private boolean checkGbtDectRef(Map<String, Map<String, Object>> gbtDectRefs, PageIndexRefQuery query) {
		// TODO Auto-generated method stub
		Map<String,Object> gbtDectRef = (Map<String,Object>)gbtDectRefs.get(query.getTableCode());
		if(gbtDectRef == null){
			return false;
		}
		if(query.getName()!= null){
			if(gbtDectRef.get(query.getName()) !=null){
				return true;
			}
			if(gbtDectRef.containsValue(query.getName())){
				return true;
			}
		}else if(query.getCode()!= null){
			if(gbtDectRef.get(query.getCode()) !=null){
				return true;
			}
			if(gbtDectRef.containsValue(query.getCode())){
				return true;
			}
		}
		return false;
	}


}
